zul/src/main/java/org/zkoss/zul/Tabbox.java

Summary

Maintainability
F
5 days
Test Coverage

Tabbox has 57 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Tabbox extends XulElement {
    private transient Tabs _tabs;
    private transient Toolbar _toolbar;
    private transient Tabpanels _tabpanels;
    private transient Tab _seltab;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 1 day to fix

    File Tabbox.java has 476 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

          public boolean insertBefore(Component child, Component refChild) {
              if (child instanceof Tabs) {
                  if (super.insertBefore(child, refChild)) {
                      _tabs = (Tabs) child;
                      for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          private void afterUnmarshal(int cnt) {
              for (Iterator<Component> it = getChildren().iterator(); it.hasNext();) {
                  final Object child = it.next();
                  if (child instanceof Tabs) {
                      _tabs = (Tabs) child;
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method selectTabDirectly has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          /* packge */void selectTabDirectly(Tab tab, boolean byClient) {
              if (tab == null)
                  throw new IllegalArgumentException("null tab");
              if (tab.getTabbox() != this)
                  throw new UiException("Not my child: " + tab);
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method beforeChildAdded has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public void beforeChildAdded(Component child, Component refChild) {
              if (child instanceof Toolbar) {
                  if (_toolbar != null && _toolbar != child)
                      throw new UiException("Only one Toolbar is allowed: " + this);
                  if (this.isVertical()) //ZK-4270: meaningful message to the developer indicating incorrect usage
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          public void setModel(ListModel<?> model) {
              if (disableFeature())
                  throw new IllegalAccessError("ZK EE version only!");
              if (model != null) {
                  if (!(model instanceof Selectable))
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.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 setOrient has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public void setOrient(String orient) throws WrongValueException {
              if (!"horizontal".equals(orient) && !"top".equals(orient) && !"bottom".equals(orient)
                      && !"vertical".equals(orient) && !"right".equals(orient) && !"left".equals(orient))
                  throw new WrongValueException("Unknow orient : " + orient);
              if (inAccordionMold())
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.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 insertBefore has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean insertBefore(Component child, Component refChild) {
              if (child instanceof Tabs) {
                  if (super.insertBefore(child, refChild)) {
                      _tabs = (Tabs) child;
                      for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
      Severity: Minor
      Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 1 hr to fix

        Method selectTabDirectly has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            /* packge */void selectTabDirectly(Tab tab, boolean byClient) {
                if (tab == null)
                    throw new IllegalArgumentException("null tab");
                if (tab.getTabbox() != this)
                    throw new UiException("Not my child: " + tab);
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if (!"horizontal".equals(orient) && !"top".equals(orient) && !"bottom".equals(orient)
                          && !"vertical".equals(orient) && !"right".equals(orient) && !"left".equals(orient))
                      throw new WrongValueException("Unknow orient : " + orient);
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Tabbox.java - About 40 mins to fix

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

                public void setMold(String mold) {
                    if (isVertical()) {
                        if (mold.startsWith("accordion")) {
                            throw new WrongValueException("Unsupported vertical orient in mold : " + mold);
                        } else {
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Tabbox.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

            Avoid too many return statements within this method.
            Open

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

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

                  protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                      super.renderProperties(renderer);
                      if (_panelSpacing != null)
                          render(renderer, "panelSpacing", _panelSpacing);
                      if (!isTop())
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.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 3 locations. Consider refactoring.
              Open

                  protected TabboxEngine newTabboxEngine() throws UiException {
                      final String PROP = "org.zkoss.zul.tabbox.engine.class";
                      final String klass = Library.getProperty(PROP);
                      if (klass == null)
                          throw new UiException("Library property,  " + PROP + ", required");
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 2 other locations - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Captcha.java on lines 388..403
              zul/src/main/java/org/zkoss/zul/Chart.java on lines 873..888

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

              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

                      } else if (child instanceof Tabs) {
                          if (_tabs != null && _tabs != child)
                              throw new UiException("Only one tabs is allowed: " + this);
                      } else if (child instanceof Tabpanels) {
                          if (_tabpanels != null && _tabpanels != child)
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 490..498

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

              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

                      } else if (child instanceof Tabpanels) {
                          if (super.insertBefore(child, refChild)) {
                              _tabpanels = (Tabpanels) child;
                              return true;
                          }
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 503..516

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

              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

                      if (!"horizontal".equals(orient) && !"top".equals(orient) && !"bottom".equals(orient)
                              && !"vertical".equals(orient) && !"right".equals(orient) && !"left".equals(orient))
                          throw new WrongValueException("Unknow orient : " + orient);
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 1 hr to fix
              zul/src/main/java/org/zkoss/zul/Area.java on lines 60..62

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

                  public void setPanelSpacing(String panelSpacing) {
                      if (panelSpacing != null && panelSpacing.length() == 0)
                          panelSpacing = null;
              
                      if (!Objects.equals(_panelSpacing, panelSpacing)) {
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 18 other locations - About 50 mins to fix
              zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
              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/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 3 locations. Consider refactoring.
              Open

                          } else if (child instanceof Toolbar) {
                              _toolbar = (Toolbar) child;
                              if (--cnt == 0)
                                  break;
                          } else if (child instanceof Tabpanels) {
              Severity: Major
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 2 other locations - About 50 mins to fix
              zul/src/main/java/org/zkoss/zul/Grid.java on lines 1623..1631
              zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 619..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 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 2 locations. Consider refactoring.
              Open

                  private void addTabsListeners() {
                      if (_tabs != null) {
                          for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
                              final Tab tab = (Tab) it.next();
                              tab.addEventListener(Events.ON_SELECT, _listener);
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 45 mins to fix
              zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 684..691

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

                  private void removeTabsListeners() {
                      if (_tabs != null) {
                          for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
                              final Tab tab = (Tab) it.next();
                              tab.removeEventListener(Events.ON_SELECT, _listener);
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 45 mins to fix
              zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 694..701

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

                  public void onPageAttached(Page newpage, Page oldpage) {
                      super.onPageAttached(newpage, oldpage);
                      if (_model != null) {
                          postOnInitRender();
                          if (_dataListener != null) {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 45 mins to fix
              zul/src/main/java/org/zkoss/zul/Chart.java on lines 1033..1042

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

                  public void setMold(String mold) {
                      if (isVertical()) {
                          if (mold.startsWith("accordion")) {
                              throw new WrongValueException("Unsupported vertical orient in mold : " + mold);
                          } else {
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 40 mins to fix
              zul/src/main/java/org/zkoss/zul/Slider.java on lines 390..400

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 50.

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

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

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

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

              Refactorings

              Further Reading

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

                              for (Iterator<Component> e = _tabs.getChildren().iterator(); e.hasNext();) {
                                  final Tab tab = (Tab) e.next();
                                  if (tab.isSelected()) {
                                      _seltab = tab;
                                      break;
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 40 mins to fix
              zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 642..648

              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

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

                              for (Iterator<Component> it = _tabs.getChildren().iterator(); it.hasNext();) {
                                  final Tab tab = (Tab) it.next();
                                  if (tab.isSelected()) {
                                      _seltab = tab;
                                      break;
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 40 mins to fix
              zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 732..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 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

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

                  private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
                      s.defaultWriteObject();
              
                      willSerialize(_model);
                      Serializables.smartWrite(s, _model);
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 1 other location - About 30 mins to fix
              zul/src/main/java/org/zkoss/zul/Tree.java on lines 1549..1556

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

              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