Showing 2,934 of 7,758 total issues

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

    static public class Node {
        List<Node> children;
        String name;

        public Node(String name) {
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenComplexVM.java on lines 50..71
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenMenuVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenNavVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenSimpleVM.java on lines 83..104

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    public void setSpacing(String spacing) {
        if (spacing != null && spacing.length() == 0)
            spacing = null;
        if (!Objects.equals(_spacing, spacing)) {
            _spacing = spacing;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Box.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 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 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/Tree.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411

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

            for (; l < len; ++l) {
                final char cc = style.charAt(l);
                if (k < 0  && cc == ':') k = l; //colon found
                else if (cc == ';') break; //done
            }
Severity: Major
Found in zcommon/src/main/java/org/zkoss/html/HTMLs.java and 2 other locations - About 50 mins to fix
zcommon/src/main/java/org/zkoss/html/HTMLs.java on lines 140..144
zcommon/src/main/java/org/zkoss/html/HTMLs.java on lines 164..168

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

        for (; l < len; ++l) {
            final char cc = style.charAt(l);
            if (k < 0  && cc == ':') k = l; //colon found
            else if (cc == ';') break; //done
        }
Severity: Major
Found in zcommon/src/main/java/org/zkoss/html/HTMLs.java and 2 other locations - About 50 mins to fix
zcommon/src/main/java/org/zkoss/html/HTMLs.java on lines 117..121
zcommon/src/main/java/org/zkoss/html/HTMLs.java on lines 164..168

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

        LabelImageElement[] lies = new LabelImageElement[] {a, auxheader, column, footer, button, caption, checkbox, combobutton, comboitem, fileupload, listheader, listcell, listfooter, menu, menuitem, nav, navitem, orgnode, radio, tab, toolbarbutton, treecol, treecell, treefooter};
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 95..95
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 113..113
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 122..122
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 131..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    public void setSpacing(String spacing) {
        if (spacing != null && spacing.length() == 0)
            spacing = null;
        if (!Objects.equals(_spacing, spacing)) {
            _spacing = spacing;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Layout.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/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    public boolean addAll(Collection<? extends E> c) {
        boolean modified = false;
        Iterator<? extends E> e = c.iterator();
        while (e.hasNext()) {
            if (add(e.next()))
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.java on lines 222..232
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelSetProxy.java on lines 207..217

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

        if (UiLifeCycle.class.isAssignableFrom(klass)) {
            try {
                _uiCycles.add((UiLifeCycle) (listener = getInstance(klass, listener)));
            } catch (Throwable ex) {
                log.error("Failed to instantiate " + klass, ex);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 390..397

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

        if (PropertiesRenderer.class.isAssignableFrom(klass)) {
            try {
                _propRends.add((PropertiesRenderer) (listener = getInstance(klass, listener)));
            } catch (Throwable ex) {
                log.error("Failed to instantiate " + klass, ex);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 5 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 349..356
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 358..365
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 366..373
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 374..381
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 382..389

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

    static public class Node{
        List<Node> children;
        String name;
        
        public Node(String name){
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenMenuVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenNavVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenSimpleVM.java on lines 83..104
zktest/src/main/java/org/zkoss/zktest/bind/parser/F80_Parser_StoreSubAnnotCntVM.java on lines 110..131

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

        LabelImageElement[] lies = new LabelImageElement[] {a, auxheader, column, footer, button, caption, checkbox, combobutton, comboitem, fileupload, listheader, listcell, listfooter, menu, menuitem, nav, navitem, orgnode, radio, tab, toolbarbutton, treecol, treecell, treefooter};
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 95..95
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 104..104
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 113..113
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 131..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

Similar blocks of code found in 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/Selectbox.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

        public TreeObject(int type, int id, String name, boolean selected,
                int status) {
            this.type = type;
            this.id = id;
            this.name = name;
zel/src/main/java/org/zkoss/zel/impl/ValueExpressionImpl.java on lines 104..111
zkbind/src/main/java/org/zkoss/bind/impl/ValidationContextImpl.java on lines 40..47
zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 63..69
zktest/src/main/java/org/zkoss/zktest/test2/F90_ZK_4375VM.java on lines 85..91

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

        public Message(Component comp, String attr, String key, String msg, Object value) {
            this.comp = comp;
            this.attr = attr;
            this.key = key;
            this.msg = msg;
zel/src/main/java/org/zkoss/zel/impl/ValueExpressionImpl.java on lines 104..111
zkbind/src/main/java/org/zkoss/bind/impl/ValidationContextImpl.java on lines 40..47
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2779_ViewModel.java on lines 99..106
zktest/src/main/java/org/zkoss/zktest/test2/F90_ZK_4375VM.java on lines 85..91

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

        public TestItem(String title, String description, String content, boolean complete, boolean error) {
            this.title = title;
            this.description = description;
            this.content = content;
            this.complete = complete;
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/F90_ZK_4375VM.java and 4 other locations - About 50 mins to fix
zel/src/main/java/org/zkoss/zel/impl/ValueExpressionImpl.java on lines 104..111
zkbind/src/main/java/org/zkoss/bind/impl/ValidationContextImpl.java on lines 40..47
zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 63..69
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2779_ViewModel.java on lines 99..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

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

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

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

Refactorings

Further Reading

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

    public ValueExpressionImpl(String expr, Node node, FunctionMapper fnMapper,
            VariableMapper varMapper, Class<?> expectedType) {
        this.expr = expr;
        this.node = node;
        this.fnMapper = fnMapper;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/ValueExpressionImpl.java and 4 other locations - About 50 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/ValidationContextImpl.java on lines 40..47
zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 63..69
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2779_ViewModel.java on lines 99..106
zktest/src/main/java/org/zkoss/zktest/test2/F90_ZK_4375VM.java on lines 85..91

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

    case TRUE:
      AstTrue jjtn001 = new AstTrue(JJTTRUE);
      boolean jjtc001 = true;
      jjtree.openNodeScope(jjtn001);
      try {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 1 other location - About 50 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1932..1943

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

    /* package */int[] getLastGroupsInfoAt(int index) {
        int[] rg = null;
        for (int[] g : _groupsInfo) {
            if (index == g[0])
                rg = g;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Rows.java on lines 236..245

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 Object setAttribute(String name, Object value, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_desktop != null) {
                if (_desktop.hasAttribute(name, true))
                    return _desktop.setAttribute(name, value, true);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java on lines 238..246

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

Severity
Category
Status
Source
Language