zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java

Summary

Maintainability
F
5 days
Test Coverage

HtmlBasedComponent has 96 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class HtmlBasedComponent extends AbstractComponent {
    /** The ZK CSS class. */
    protected String _zclass;
    /** The prolog content that shall be generated before real content. */
    private String _prolog;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 day to fix

    File HtmlBasedComponent.java has 575 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* HtmlBasedComponent.java
    
        Purpose:
    
        Description:
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 day to fix

      Method renderProperties has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
              super.renderProperties(renderer);
      
              if (_auxinf != null) {
                  render(renderer, "width", _auxinf.width);
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method service has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void service(AuRequest request, boolean everError) {
              final String cmd = request.getCommand();
              if (cmd.equals(Events.ON_CLICK) || cmd.equals(Events.ON_DOUBLE_CLICK) || cmd.equals(Events.ON_RIGHT_CLICK)
                      || cmd.equals(Events.ON_MOUSE_OVER) || cmd.equals(Events.ON_MOUSE_OUT)) {
                  Events.postEvent(MouseEvent.getMouseEvent(request));
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix

        Method addSclass has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public void addSclass(String cssClass) {
                if (!Strings.isEmpty(cssClass)) {
                    String sclass = getSclass();
                    if (sclass == null) {
                        setSclass(cssClass);
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method service has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public void service(AuRequest request, boolean everError) {
                final String cmd = request.getCommand();
                if (cmd.equals(Events.ON_CLICK) || cmd.equals(Events.ON_DOUBLE_CLICK) || cmd.equals(Events.ON_RIGHT_CLICK)
                        || cmd.equals(Events.ON_MOUSE_OVER) || cmd.equals(Events.ON_MOUSE_OUT)) {
                    Events.postEvent(MouseEvent.getMouseEvent(request));
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method renderProperties has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                super.renderProperties(renderer);
        
                if (_auxinf != null) {
                    render(renderer, "width", _auxinf.width);
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java - About 1 hr to fix

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

              public void removeSclass(String cssClass) {
                  String sclass = getSclass();
                  if (sclass != null) {
                      String[] input = cssClass.split(" ");
                      String cur = " " + sclass + " ";
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.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 8 locations. Consider refactoring.
          Open

              protected void setHeight0(String height) {
                  if (height != null && height.length() == 0)
                      height = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.height : null, height)) {
                      initAuxInfo0().height = height;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              public void setSclass(String sclass) {
                  if (sclass != null && sclass.length() == 0)
                      sclass = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.sclass : null, sclass)) {
                      initAuxInfo0().sclass = sclass;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              public void setClientAction(String action) {
                  if (action != null && action.length() == 0)
                      action = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.action : null, action)) {
                      initAuxInfo0().action = action;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627

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

              protected void setVflex0(String flex) {
                  if (flex != null && flex.length() == 0)
                      flex = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.vflex : null, flex)) {
                      initAuxInfo0().vflex = flex;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              protected void setHflex0(String flex) {
                  if (flex != null && flex.length() == 0)
                      flex = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.hflex : null, flex)) {
                      initAuxInfo0().hflex = flex;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              protected void setWidth0(String width) {
                  if (width != null && width.length() == 0)
                      width = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.width : null, width)) {
                      initAuxInfo0().width = width;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              public void setStyle(String style) {
                  if (style != null && style.length() == 0)
                      style = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.style : null, style)) {
                      initAuxInfo0().style = style;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 285..292
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              public void setTooltiptext(String tooltiptext) {
                  if (tooltiptext != null && tooltiptext.length() == 0)
                      tooltiptext = null;
                  if (!Objects.equals(_auxinf != null ? _auxinf.tooltiptext : null, tooltiptext)) {
                      initAuxInfo0().tooltiptext = tooltiptext;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 7 other locations - About 1 hr to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 181..188
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 211..218
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 354..361
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 434..441
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 567..574
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 620..627
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 731..738

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

              public void setZclass(String zclass) {
                  if (zclass != null && zclass.length() == 0)
                      zclass = null;
                  if (!Objects.equals(_zclass, zclass)) {
                      _zclass = zclass;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 18 other locations - About 50 mins to fix
          zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
          zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
          zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
          zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
          zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
          zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
          zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
          zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
          zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
          zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
          zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
          zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
          zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
          zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
          zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
          zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
          zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
          zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

          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 setTop(String top) {
                  if (!Objects.equals(_auxinf != null ? _auxinf.top : null, top)) {
                      initAuxInfo0().top = top;
                      smartUpdate("top", top);
                  }
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 3 other locations - About 40 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 100..105
          zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 105..110
          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 setLeft(String left) {
                  if (!Objects.equals(_auxinf != null ? _auxinf.left : null, left)) {
                      initAuxInfo0().left = left;
                      smartUpdate("left", left);
                  }
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 3 other locations - About 40 mins to fix
          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
          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 2 locations. Consider refactoring.
          Open

              public void setWidth(String width) {
                  if (getHflex() != null && !(width == null || getHflex().equals("min"))) {
                      throw new UiException("Not allowed to set hflex and width at the same time except hflex=\"min\"");
                  }
                  setWidth0(width);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 171..176

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

          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 setVflex(String flex) {
                  if (getHeight() != null && !(flex == null || "min".equals(flex))) {
                      throw new UiException("Not allowed to set vflex and height at the same time except vflex=\"min\"");
                  }
                  setVflex0(flex);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 610..615

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

          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 setHeight(String height) {
                  if (getVflex() != null && !(height == null || getVflex().equals("min"))) {
                      throw new UiException("Not allowed to set vflex and height at the same time except vflex=\"min\"");
                  }
                  setHeight0(height);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 201..206

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

          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 setHflex(String flex) {
                  if (getWidth() != null && !(flex == null || "min".equals(flex))) {
                      throw new UiException("Not allowed to set hflex and width at the same time except hflex=\"min\"");
                  }
                  setHflex0(flex);
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 1 other location - About 35 mins to fix
          zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 557..562

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

          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 HtmlBasedComponent clone = (HtmlBasedComponent) super.clone();
                  if (_auxinf != null)
                      clone._auxinf = (AuxInfo) _auxinf.clone();
                  return clone;
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 10 other locations - About 30 mins to fix
          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/LabelImageElement.java on lines 503..508
          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