Showing 7,775 of 7,775 total issues

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

    public boolean addToSelection(E child) {
        final int[] path = getPath(child);
        if (path != null && path.length > 0)
            return addSelectionPath(path);
        return false;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 636..641

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

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

    public void setWidth(String w) {
        if (Objects.equals(w, getWidth())) {
            return;
        }
        _intWidth = Chart.stringToInt(w);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Captcha.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Captcha.java on lines 207..214

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

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

    public Object getZScriptVariable(String name) {
        for (Interpreter ip : getLoadedInterpreters()) {
            final Object val = ip.getVariable(name);
            if (val != null)
                return val;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 598..605

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

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

        if (child instanceof Groupfoot) {
            if (!hasGroup())
                throw new UiException("Groupfoot cannot exist alone, you have to add a Group first");
            if (refChild == null) {
                if (getLastChild() instanceof Groupfoot)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1647..1654

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

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

                if(sdf.format(d).compareTo(today)<=0){
                    setMessage2("date "+p.getProperty()+" must large than today");
                    ctx.setInvalid();
                    return;
                }
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/F0011.java and 1 other location - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/bind/issue/F0011.java on lines 63..67

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

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

    private Map createObjectContainer(ContainerFactory containerFactory){
        if(containerFactory == null)
            return new JSONObject();
        Map m = containerFactory.createObjectContainer();
        
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/json/parser/JSONParser.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/json/parser/JSONParser.java on lines 285..293

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

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

        public void cleanup(Desktop desktop) throws Exception {
            final DesktopInfo di;
            synchronized (_dtInfos) {
                di = _dtInfos.remove(desktop);
            }
zk/src/main/java/org/zkoss/zk/ui/event/impl/ServerPushEventQueue.java on lines 140..147

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

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

        if ((_auxinf != null ? _auxinf.maxlength : 0) != maxlength) {
            initAuxInfoForInputElement().maxlength = maxlength;
            smartUpdate("maxlength", getMaxlength());
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Label.java on lines 79..82

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

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

package org.zkoss.zktest.bind.issue;

import org.zkoss.bind.annotation.ExecutionArgParam;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.ScopeParam;
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01472BindIncludeArgInner.java on lines 1..23

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

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

                fixGroupIndex(fixFrom, jfrom >= 0 && jto >= 0 ? jfrom > jto ? jfrom : jto : -1, !isReorder);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1714..1714

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

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

                    fixItemIndices(fixFrom, jfrom >= 0 && jto >= 0 ? jfrom > jto ? jfrom : jto : -1, !isReorder);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Rows.java on lines 314..314

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

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

        for (int j = 0; j< clses.length; ++j)
            try {
                return getMethodInPublic(clses[j], name, argTypes);
            } catch (NoSuchMethodException ex) { //ignore it
            }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/lang/Classes.java on lines 1204..1208

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

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

    public void updatePreviousInsertion(Component newPreviousInsertion) {
        if (_previousInsertion == newPreviousInsertion)
            return; // do nothing

        _previousInsertion = newPreviousInsertion;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java on lines 203..212

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

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

    public void updateNextInsertion(Component newNextInsertion) {
        if (_nextInsertion == newNextInsertion)
            return; // do nothing

        _nextInsertion = newNextInsertion;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java on lines 180..189

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

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

    public Object clone() {
        final Cell clone = (Cell) super.clone();
        if (_auxinf != null)
            clone._auxinf = (AuxInfo) _auxinf.clone();
        return clone;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Cell.java and 10 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 1057..1062
zul/src/main/java/org/zkoss/zul/Button.java on lines 282..287
zul/src/main/java/org/zkoss/zul/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

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

    public Object clone() {
        final Menuitem clone = (Menuitem) super.clone();
        if (_auxinf != null)
            clone._auxinf = (AuxInfo) _auxinf.clone();
        return clone;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Menuitem.java and 10 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 1057..1062
zul/src/main/java/org/zkoss/zul/Button.java on lines 282..287
zul/src/main/java/org/zkoss/zul/Cell.java on lines 112..117
zul/src/main/java/org/zkoss/zul/Label.java on lines 188..193
zul/src/main/java/org/zkoss/zul/Listcell.java on lines 60..65
zul/src/main/java/org/zkoss/zul/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

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

    public class FoodComparator implements Comparator, Serializable {
        
        public int compare(Object o1, Object o2) {
            Food data = (Food) o1;
            Food data2 = (Food) o2;
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModelListbox.java on lines 146..154
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModelListboxMultiple.java on lines 159..167
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModel.java on lines 113..121
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListbox.java on lines 136..144
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListboxMultiple.java on lines 149..157
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2534Group.java on lines 176..184

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

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

    public Object clone() {
        final Treecell clone = (Treecell) super.clone();
        if (_auxinf != null)
            clone._auxinf = (AuxInfo) _auxinf.clone();
        return clone;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecell.java and 10 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 1057..1062
zul/src/main/java/org/zkoss/zul/Button.java on lines 282..287
zul/src/main/java/org/zkoss/zul/Cell.java on lines 112..117
zul/src/main/java/org/zkoss/zul/Label.java on lines 188..193
zul/src/main/java/org/zkoss/zul/Listcell.java on lines 60..65
zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 278..283
zul/src/main/java/org/zkoss/zul/Textbox.java on lines 223..228
zul/src/main/java/org/zkoss/zul/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

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

    public class FoodComparator implements Comparator, Serializable {
        
        public int compare(Object o1, Object o2) {
            Food data = (Food) o1;
            Food data2 = (Food) o2;
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModel.java on lines 123..131
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModelListbox.java on lines 146..154
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModel.java on lines 113..121
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListbox.java on lines 136..144
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListboxMultiple.java on lines 149..157
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2534Group.java on lines 176..184

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

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

    public class FoodComparator implements Comparator, Serializable {
        
        public int compare(Object o1, Object o2) {
            Food data = (Food) o1;
            Food data2 = (Food) o2;
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModel.java on lines 123..131
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModelListbox.java on lines 146..154
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModelListboxMultiple.java on lines 159..167
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModel.java on lines 113..121
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListboxMultiple.java on lines 149..157
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2534Group.java on lines 176..184

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

Severity
Category
Status
Source
Language