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

Summary

Maintainability
F
5 days
Test Coverage

File Radiogroup.java has 556 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Radiogroup.java

    Purpose:

    Description:
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 day to fix

    Radiogroup has 59 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Radiogroup extends XulElement implements Disable {
        private static final Logger log = LoggerFactory.getLogger(Radiogroup.class);
    
        private static final String ZUL_RADIOGROUP_ON_INITRENDER = "zul.Radiogroup.ON_INITRENDER";
        private String _orient = "horizontal";
    Severity: Major
    Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 day to fix

      Method render has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public void render(final Radio item, final Object data, final int index) throws Exception {
                  final Radiogroup cb = (Radiogroup) item.getParent();
                  final Template tm = cb.getTemplate("model");
                  if (tm == null) {
                      item.setLabel(Objects.toString(data));
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 2 hrs to fix

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

            public void setModel(ListModel<?> model) {
                if (model != null) {
                    if (!(model instanceof Selectable))
                        throw new UiException(model.getClass() + " must implement " + Selectable.class);
        
        
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 fixSelectedIndex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            /*package*/ void fixSelectedIndex() {
                final MutableInteger cur = new MutableInteger(0);
                _jsel = fixSelIndex(this, cur);
        
                if (_jsel < 0 && _externs != null)
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 fixSelIndex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private static int fixSelIndex(Component comp, MutableInteger cur) {
                for (Iterator it = comp.getChildren().iterator(); it.hasNext();) {
                    final Component child = (Component) it.next();
                    if (child instanceof Radio) {
                        if (((Radio) child).isSelected())
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 getAt has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private static Radio getAt(Component comp, MutableInteger cur, int index) {
                for (Iterator it = comp.getChildren().iterator(); it.hasNext();) {
                    final Component child = (Component) it.next();
                    if (child instanceof Radio) {
                        if (cur.value++ == index)
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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 onInitRender has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @SuppressWarnings("rawtypes")
            public void onInitRender(Event data) {
                //Bug #2010389
                removeAttribute(ZUL_RADIOGROUP_ON_INITRENDER); //clear syncModel flag
                final Renderer renderer = new Renderer();
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 1 hr to fix

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

              public Radio getItemAtIndex(int index) {
                  if (index < 0)
                      throw new IndexOutOfBoundsException("Wrong index: " + index);
          
                  final MutableInteger cur = new MutableInteger(0);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 55 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

          Method doSelectionChanged has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              private void doSelectionChanged() {
                  final Selectable<Object> smodel = getSelectableModel();
                  if (smodel.isSelectionEmpty()) {
                      if (_jsel >= 0)
                          setSelectedItem(null);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 45 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

          Method setSelectedIndex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public void setSelectedIndex(int jsel) {
                  if (jsel < 0)
                      jsel = -1;
                  if (_jsel != jsel) {
                      if (jsel < 0) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 45 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

          Method onChildAdded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public void onChildAdded(Component child) {
                  super.onChildAdded(child);
                  if (_disabled) {
                      if (child instanceof Radio) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 45 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

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

              @SuppressWarnings("rawtypes")
              public void onInitRender(Event data) {
                  //Bug #2010389
                  removeAttribute(ZUL_RADIOGROUP_ON_INITRENDER); //clear syncModel flag
                  final Renderer renderer = new Renderer();
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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

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

              public Object clone() {
                  final Radiogroup clone = (Radiogroup) super.clone();
                  fixClone(clone);
                  if (clone._model != null) {
                      if (clone._model instanceof ComponentCloneListener) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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

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

                  @SuppressWarnings("unchecked")
                  private void render(Radio item, Object value, int index) throws Throwable {
                      if (!_rendered && (_renderer instanceof RendererCtrl)) {
                          ((RendererCtrl) _renderer).doTry();
                          _ctrled = true;
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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

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

              public List<Radio> getItems() {
                  //FUTURE: the algorithm is stupid and it shall be similar to Listbox
                  //however, it is OK since there won't be many radio buttons in a group
                  final List<Radio> items = new ArrayList<Radio>();
                  getItems0(this, items);
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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

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

              public int getItemCount() {
                  int sum = countItems(this);
                  if (_externs != null)
                      for (Radio radio : _externs) {
                          if (!isRedudant(radio))
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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

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

                  public void render(final Radio item, final Object data, final int index) throws Exception {
                      final Radiogroup cb = (Radiogroup) item.getParent();
                      final Template tm = cb.getTemplate("model");
                      if (tm == null) {
                          item.setLabel(Objects.toString(data));
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 25 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              @SuppressWarnings("rawtypes")
              private static final RadioRenderer _defRend = new RadioRenderer() {
                  public void render(final Radio item, final Object data, final int index) throws Exception {
                      final Radiogroup cb = (Radiogroup) item.getParent();
                      final Template tm = cb.getTemplate("model");
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 1 other location - About 4 hrs to fix
          zul/src/main/java/org/zkoss/zul/Combobox.java on lines 536..609

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

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

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

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

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

          Refactorings

          Further Reading

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

                  if (clone._model != null) {
                      if (clone._model instanceof ComponentCloneListener) {
                          final ListModel model = (ListModel) ((ComponentCloneListener) clone._model).willClone(clone);
                          if (model != null)
                              clone._model = model;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 1 other location - About 1 hr to fix
          zul/src/main/java/org/zkoss/zul/Chart.java on lines 1020..1028

          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

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

              public void setOrient(String orient) throws WrongValueException {
                  if (!"horizontal".equals(orient) && !"vertical".equals(orient))
                      throw new WrongValueException("orient cannot be " + orient);
          
                  if (!Objects.equals(_orient, orient)) {
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 3 other locations - About 55 mins to fix
          zul/src/main/java/org/zkoss/zul/Menubar.java on lines 58..66
          zul/src/main/java/org/zkoss/zul/Slider.java on lines 96..103
          zul/src/main/java/org/zkoss/zul/Toolbar.java on lines 101..109

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

          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 setName(String name) {
                  if (name != null && name.length() == 0)
                      name = null;
                  if (!Objects.equals(_name, name)) {
                      _name = name;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.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/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

          Identical 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(null);
                      if (_dataListener != null) {
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 1 other location - About 45 mins to fix
          zul/src/main/java/org/zkoss/zul/Combobox.java on lines 1268..1277

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

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

                  private void doCatch(Throwable ex) {
                      if (_ctrled) {
                          try {
                              ((RendererCtrl) _renderer).doCatch(ex);
                          } catch (Throwable t) {
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 4 other locations - About 40 mins to fix
          zul/src/main/java/org/zkoss/zul/Combobox.java on lines 660..670
          zul/src/main/java/org/zkoss/zul/Grid.java on lines 1224..1234
          zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2798..2808
          zul/src/main/java/org/zkoss/zul/Tree.java on lines 2394..2404

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

          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