zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java

Summary

Maintainability
D
3 days
Test Coverage

LabelImageElement has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class LabelImageElement extends LabelElement {
    private AuxInfo _auxinf;

    protected LabelImageElement() {
    }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java - About 6 hrs to fix

    File LabelImageElement.java has 295 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* LabelImageElement.java
    
        Purpose:
    
        Description:
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java - About 3 hrs to fix

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

              public Media getMedia(String pathInfo) {
                  if (pathInfo != null) {
                      int j = pathInfo.indexOf('/', 1);
                      if (j >= 0) {
                          int k = pathInfo.indexOf('/', ++j);
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java - About 35 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          private String getEncodedImageURL() {
              if (_auxinf != null && _auxinf.image instanceof Image) {
                  final Image image = (Image) _auxinf.image;
                  return Utils.getDynamicMediaURI(this, //already encoded
                          _auxinf.imgver, "c/" + image.getName(), image.getFormat());
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 344..353

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

      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

          private String getEncodedHoverURL() {
              if (_auxinf != null && _auxinf.hoverimg instanceof Image) {
                  final Image image = (Image) _auxinf.hoverimg;
                  return Utils.getDynamicMediaURI(this, _auxinf.hoverimgver, "h/" + image.getName(), image.getFormat());
              }
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 329..339

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

      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

              _properties.put("imageContent", new ObjectPropertyAccess() {
                  public void setValue(Component cmp, Object image) {
                      if (image instanceof Image)
                          ((LabelImageElement) cmp).setImageContent((Image) image);
                      else if (image instanceof RenderedImage)
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 477..492

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 76.

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

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

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

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

      Refactorings

      Further Reading

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

              _properties.put("hoverImageContent", new ObjectPropertyAccess() {
                  public void setValue(Component cmp, Object image) {
                      if (image instanceof Image)
                          ((LabelImageElement) cmp).setHoverImageContent((Image) image);
                      else if (image instanceof RenderedImage)
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 452..467

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 76.

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

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

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

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

      Refactorings

      Further Reading

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

          public void setImage(String src) {
              if (src != null && src.length() == 0)
                  src = null;
              if (!Objects.equals(_auxinf != null ? _auxinf.image : null, src)) {
                  initAuxInfo().image = src;
      zul/src/main/java/org/zkoss/zul/A.java on lines 140..147
      zul/src/main/java/org/zkoss/zul/Button.java on lines 191..198
      zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 209..216
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 257..264

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 74.

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

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

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

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

      Refactorings

      Further Reading

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

          public void setHoverImage(String src) {
              if (src != null && src.length() == 0)
                  src = null;
              if (!Objects.equals(_auxinf != null ? _auxinf.hoverimg : null, src)) {
                  initAuxInfo().hoverimg = src;
      zul/src/main/java/org/zkoss/zul/A.java on lines 140..147
      zul/src/main/java/org/zkoss/zul/Button.java on lines 191..198
      zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 209..216
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 185..192

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 74.

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

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

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

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

      Refactorings

      Further Reading

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

          public void setIconTooltip(String iconTooltip) {
              if (iconTooltip != null && iconTooltip.isEmpty())
                  iconTooltip = null;
              if (!Objects.equals(_auxinf != null ? _auxinf.iconTooltips : null, iconTooltip)) {
                  initAuxInfo().iconTooltip = iconTooltip;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 91..98

      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 setIconSclass(String iconSclass) {
              if (iconSclass != null && iconSclass.isEmpty())
                  iconSclass = null;
              if (!Objects.equals(_auxinf != null ? _auxinf.iconSclass : null, iconSclass)) {
                  initAuxInfo().iconSclass = iconSclass;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 1 hr to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 133..140

      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 setImageContent(Image image) {
              if ((_auxinf != null ? _auxinf.image : null) != image) {
                  initAuxInfo().image = image;
                  if (image != null)
                      _auxinf.imgver++; //enforce browser to reload image
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 50 mins to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 288..295

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

      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 setHoverImageContent(Image image) {
              if ((_auxinf != null ? _auxinf.hoverimg : null) != image) {
                  initAuxInfo().hoverimg = image;
                  if (image != null)
                      _auxinf.hoverimgver++; //enforce browser to reload image
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 50 mins to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 203..210

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

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

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

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

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

      Refactorings

      Further Reading

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

          private static class AuxInfo implements java.io.Serializable, Cloneable {
              /** The image; either String or Image. */
              private Object image;
              /** The hover image; either String or Image. */
              private Object hoverimg;
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 45 mins to fix
      zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 1127..1150

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

      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 void setIconSclasses(String[] iconSclasses) {
              if (!Objects.equals(_auxinf != null ? _auxinf.iconSclasses : null, iconSclasses)) {
                  initAuxInfo().iconSclasses = iconSclasses;
                  smartUpdate("iconSclasses", iconSclasses);
              }
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 3 other locations - About 40 mins to fix
      zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 100..105
      zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 118..123
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 147..152

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

      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 void setIconTooltips(String[] iconTooltips) {
              if (!Objects.equals(_auxinf != null ? _auxinf.iconTooltips : null, iconTooltips)) {
                  initAuxInfo().iconTooltips = iconTooltips;
                  smartUpdate("iconTooltips", iconTooltips);
              }
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 3 other locations - About 40 mins to fix
      zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 100..105
      zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 118..123
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 105..110

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

      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

              _properties.put("iconTooltips", new ObjectPropertyAccess() {
                  public void setValue(Component cmp, Object iconTooltip) {
                      ((LabelImageElement) cmp).setIconTooltips((String[]) iconTooltip);
                  }
      
      
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 35 mins to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 416..424

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

      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

              _properties.put("iconSclasses", new ObjectPropertyAccess() {
                  public void setValue(Component cmp, Object iconSclasses) {
                      ((LabelImageElement) cmp).setIconSclasses((String[]) iconSclasses);
                  }
      
      
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 1 other location - About 35 mins to fix
      zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 434..442

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

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

          public Object clone() {
              final LabelImageElement clone = (LabelImageElement) super.clone();
              if (_auxinf != null)
                  clone._auxinf = (AuxInfo) _auxinf.clone();
              return clone;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java and 10 other locations - About 30 mins to fix
      zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 1057..1062
      zul/src/main/java/org/zkoss/zul/Button.java on lines 282..287
      zul/src/main/java/org/zkoss/zul/Cell.java on lines 112..117
      zul/src/main/java/org/zkoss/zul/Label.java on lines 188..193
      zul/src/main/java/org/zkoss/zul/Listcell.java on lines 60..65
      zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 278..283
      zul/src/main/java/org/zkoss/zul/Textbox.java on lines 223..228
      zul/src/main/java/org/zkoss/zul/Treecell.java on lines 125..130
      zul/src/main/java/org/zkoss/zul/impl/InputElement.java on lines 1114..1119
      zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 485..490

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status