Showing 2,934 of 7,758 total issues

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

    public boolean sort(boolean ascending) {
        final String dir = getSortDirection();
        if (ascending) {
            if ("ascending".equals(dir))
                return false;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 362..373
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 414..424

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

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

    public void setTitle(String title) {
        if (title == null)
            title = "";
        if (!Objects.equals(_title, title)) {
            _title = title;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Panel.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 125..132
zul/src/main/java/org/zkoss/zul/Groupbox.java on lines 168..175
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Menu.java on lines 102..109
zul/src/main/java/org/zkoss/zul/Window.java on lines 392..399
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 46..53

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

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

    public void setContent(String content) {
        if (content == null)
            content = "";
        if (!Objects.equals(_content, content)) {
            _content = content;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Menu.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 125..132
zul/src/main/java/org/zkoss/zul/Groupbox.java on lines 168..175
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Panel.java on lines 437..444
zul/src/main/java/org/zkoss/zul/Window.java on lines 392..399
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 46..53

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

    public boolean sort(boolean ascending) {
        final String dir = getSortDirection();
        if (ascending) {
            if ("ascending".equals(dir))
                return false;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listheader.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 362..373
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 369..379

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

            for (String key : compBindings.keySet()) {
                final BindingKey bkey = getBindingKey(comp, key);
                if (loadinit) {
                    _childrenBindingHandler.doInit(comp, bkey);
                }
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 2 other locations - About 40 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 2586..2592
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 2593..2599

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

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

    public void setTitle(String title) {
        if (title == null)
            title = "";
        if (!Objects.equals(_title, title)) {
            _title = title;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Window.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 125..132
zul/src/main/java/org/zkoss/zul/Groupbox.java on lines 168..175
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Menu.java on lines 102..109
zul/src/main/java/org/zkoss/zul/Panel.java on lines 437..444
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 46..53

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

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

    public void setTitle(String title) {
        if (title == null)
            title = "";
        if (!Objects.equals(_title, title)) {
            _title = title;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Groupbox.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 125..132
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Menu.java on lines 102..109
zul/src/main/java/org/zkoss/zul/Panel.java on lines 437..444
zul/src/main/java/org/zkoss/zul/Window.java on lines 392..399
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 46..53

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

    private static List getItems(int items) {
        List Items = new ArrayList();
        for (int i = 0; i < items; i++) {
            Items.add(new String("data "+i));
        }
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelSets.java on lines 46..52
zktest/src/main/java/org/zkoss/zktest/test2/select/models/SimpleListModels.java on lines 48..54

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

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

    public void setLabel(String label) {
        if (label == null)
            label = "";
        if (!Objects.equals(_label, label)) {
            _label = label;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/LabelElement.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 125..132
zul/src/main/java/org/zkoss/zul/Groupbox.java on lines 168..175
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Menu.java on lines 102..109
zul/src/main/java/org/zkoss/zul/Panel.java on lines 437..444
zul/src/main/java/org/zkoss/zul/Window.java on lines 392..399

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

            for (String key : compBindings.keySet()) {
                final BindingKey bkey = getBindingKey(comp, key);
                if (loadinit) {
                    _propertyBindingHandler.doInit(comp, bkey);
                }
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 2 other locations - About 40 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 2586..2592
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 2600..2607

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

    private static List getItems(int items) {
        List Items = new ArrayList();
        for (int i = 0; i < items; i++) {
            Items.add(new String("data "+i));
        }
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelLists.java on lines 46..52
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelSets.java on lines 46..52

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

    public boolean sort(boolean ascending) {
        final String dir = getSortDirection();
        if (ascending) {
            if ("ascending".equals(dir))
                return false;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Column.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 414..424
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 369..379

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

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

    public void setAutodisable(String autodisable) {
        if (autodisable == null)
            autodisable = "";
        if (!Objects.equals(_autodisable, autodisable)) {
            _autodisable = autodisable;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Checkbox.java and 7 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Anchorchildren.java on lines 68..75
zul/src/main/java/org/zkoss/zul/Groupbox.java on lines 168..175
zul/src/main/java/org/zkoss/zul/Hlayout.java on lines 41..48
zul/src/main/java/org/zkoss/zul/Menu.java on lines 102..109
zul/src/main/java/org/zkoss/zul/Panel.java on lines 437..444
zul/src/main/java/org/zkoss/zul/Window.java on lines 392..399
zul/src/main/java/org/zkoss/zul/impl/LabelElement.java on lines 46..53

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

    static public class MyTreeNode extends DefaultTreeNode<String> {

        boolean open;

        public MyTreeNode(String data, MyTreeNode[] children) {
zktest/src/main/java/org/zkoss/zktest/bind/basic/TreeSelectionVM.java on lines 79..98

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

                if (sel < 0 || sel < begin || sel >= end) { //not in selection range
                    sel = size > oldsize ? (end - 1) : begin;
                }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Tree.java on lines 2962..2964

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

        if (len < 0 || (offset + len) > textLen) {
            throw new IllegalArgumentException(
                    "Invalid (offset, len). offset=" + offset + ", len=" + len + ", text.length=" + textLen);
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.java and 1 other location - About 40 mins to fix
zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.java on lines 543..546

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

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

    public static final int hashCode(byte[] v) {
        int h = 1; //not to return 0 if possible, so caller cache it easily
        for (int j=v.length; --j>=0;)
            h = nextHashCode(h, v[j]);
        return h;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 138..143
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 151..156
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 164..169

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

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

    public static final int hashCode(short[] v) {
        int h = 1; //not to return 0 if possible, so caller cache it easily
        for (int j=v.length; --j>=0;)
            h = nextHashCode(h, v[j]);
        return h;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/lang/Objects.java and 3 other locations - About 40 mins to fix
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 110..115
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 138..143
zcommon/src/main/java/org/zkoss/lang/Objects.java on lines 164..169

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

        if (collector != null) {
            collector.addInfo(new ValidationInfo(ValidationInfo.PROP, getComponent(), getValidatorExpressionString(),
                    validator.toString(), Boolean.valueOf(vctx.isValid()),
                    ((BindContextImpl) vctx.getBindContext()).getValidatorArgs(), null));
        }
zkbind/src/main/java/org/zkoss/bind/impl/SaveFormBindingImpl.java on lines 291..295

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

    public class AdultConverter implements Converter{

        public Object coerceToUi(Object val, Component component, BindContext ctx) {
            return val;
        }
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 195..210

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

Severity
Category
Status
Source
Language