Showing 2,934 of 7,758 total issues

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

    private void replaceComponent (Component oc, Component nc) {
        Component parent = oc.getParent();
        Component ref = oc.getNextSibling();
        oc.detach();
        parent.insertBefore(nc, ref);
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingMapTestVM.java on lines 109..114
zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3681_Validator_VM.java on lines 96..101
zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/ForEachListModelVM.java on lines 158..163

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

    public Tree getTree() {
        for (Component p = this; (p = p.getParent()) != null;)
            if (p instanceof Tree)
                return (Tree) p;
        return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treerow.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Treecell.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treechildren.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 395..400

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 4 locations. Consider refactoring.
Open

    public Tree getTree() {
        for (Component n = this; (n = n.getParent()) != null;)
            if (n instanceof Tree)
                return (Tree) n;
        return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecell.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Treechildren.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 395..400
zul/src/main/java/org/zkoss/zul/Treerow.java on lines 41..46

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

    private void replaceComponent(Component oc, Component nc) {
        Component parent = oc.getParent();
        Component ref = oc.getNextSibling();
        oc.detach();
        parent.insertBefore(nc, ref);
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingMapTestVM.java on lines 109..114
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingSupportListModelVM.java on lines 167..172
zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3681_Validator_VM.java on lines 96..101

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

    private void replaceComponent(Component oc, Component nc) {
        Component parent = oc.getParent();
        Component ref = oc.getNextSibling();
        oc.detach();
        parent.insertBefore(nc, ref);
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingMapTestVM.java on lines 109..114
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingSupportListModelVM.java on lines 167..172
zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/ForEachListModelVM.java on lines 158..163

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

    public Tree getTree() {
        for (Component p = this; (p = p.getParent()) != null;)
            if (p instanceof Tree)
                return (Tree) p;
        return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treechildren.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Treecell.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treeitem.java on lines 395..400
zul/src/main/java/org/zkoss/zul/Treerow.java on lines 41..46

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

    private Set<MyItem> getFilteredList() {
        final Set<MyItem> itemsToShowAfterFilter = new HashSet<>(gridItemList);
        itemsToShowAfterFilter.removeIf(item -> (item.v3 % 8 == 0));
        return itemsToShowAfterFilter;
    }
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017Composer.java on lines 62..66
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017ListboxComposer.java on lines 62..66

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

    public Tree getTree() {
        for (Component p = this; (p = p.getParent()) != null;)
            if (p instanceof Tree)
                return (Tree) p;
        return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treeitem.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Treecell.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treechildren.java on lines 52..57
zul/src/main/java/org/zkoss/zul/Treerow.java on lines 41..46

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

    private Set<B86_ZK_4017MyItem> getFilteredList() {
        final Set<B86_ZK_4017MyItem> itemsToShowAfterFilter = new HashSet<>(itemList);
        itemsToShowAfterFilter.removeIf(item -> (item.v3 % 8 == 0));
        return itemsToShowAfterFilter;
    }
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017ListboxComposer.java on lines 62..66
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4020Composer.java on lines 86..90

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

    private Set<B86_ZK_4017MyItem> getFilteredList() {
        final Set<B86_ZK_4017MyItem> itemsToShowAfterFilter = new HashSet<>(itemList);
        itemsToShowAfterFilter.removeIf(item -> (item.v3 % 8 == 0));
        return itemsToShowAfterFilter;
    }
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017Composer.java on lines 62..66
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4020Composer.java on lines 86..90

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

    private void replaceComponent (Component oc, Component nc) {
        Component parent = oc.getParent();
        Component ref = oc.getNextSibling();
        oc.detach();
        parent.insertBefore(nc, ref);
zktest/src/main/java/org/zkoss/zktest/bind/issue/F02545ChildrenBindingSupportListModelVM.java on lines 167..172
zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3681_Validator_VM.java on lines 96..101
zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/ForEachListModelVM.java on lines 158..163

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

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

    public AMedia(String name, String format, String ctype, byte[] data) {
        if (data == null)
            throw new IllegalArgumentException("data");
        _bindata = data;
        setup(name, format, ctype);
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/media/AMedia.java and 3 other locations - About 30 mins to fix
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 99..104
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 120..125
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 139..144

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

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

    public AMedia(String name, String format, String ctype, String data) {
        if (data == null)
            throw new IllegalArgumentException("data");
        _strdata = data;
        setup(name, format, ctype);
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/media/AMedia.java and 3 other locations - About 30 mins to fix
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 84..89
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 120..125
zcommon/src/main/java/org/zkoss/util/media/AMedia.java on lines 139..144

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

        @Command
        public void show(@ContextParam(ContextType.BINDER) BinderImpl binder, @SelectorParam("#formDiv") Component formComp) {
            Set<SaveBinding> bindings = binder.getFormAssociatedSaveBindings(formComp);
            Clients.log("FormAssociatedSaveBindings: " + bindings.size());
            Clients.log(bindings.toString());
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4722VM.java and 1 other location - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4722VM.java on lines 45..50

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

    @SuppressWarnings("unchecked")
    public Object clone() {
        SimpleListModel clone = (SimpleListModel) super.clone();
        if (_data != null)
            clone._data = ArraysX.duplicate(_data);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/SimpleListModel.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/ListModelArray.java on lines 206..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 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

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

        private GroupDataInfo(byte type, int groupIndex, int offset, boolean open) {
            _type = type;
            _groupIndex = groupIndex;
            _offset = offset;
            _open = open;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/GroupsListModel.java and 3 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java on lines 100..105
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01698TreePerformance.java on lines 67..72
zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/ActionContextImpl.java on lines 38..43

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

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

        public TreePerformanceTestData(String dataOne, String dataTwo, String dataThree, B01698TreePerformance vm) {
            _dataOne = dataOne;
            _dataTwo = dataTwo;
            _dataThree = dataThree;
            _vm = vm;
zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java on lines 100..105
zul/src/main/java/org/zkoss/zul/impl/GroupsListModel.java on lines 435..440
zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/ActionContextImpl.java on lines 38..43

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

    @Command("addTag")
    public void onAddTag(@BindingParam("form") Item form,
                         @BindingParam("tagValue") String tagValue) {
        Set<Tag> tags = (Set<Tag>) form.getTags();
        tags.add(new Tag(tagValue));
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithSet.java on lines 82..88

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

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

        private RealInits(Initiator[] sysinits, List<Initiator> inits, boolean sysinitEx, boolean initEx) {
            _sysinits = sysinits;
            _inits = inits;
            _sysinitEx = sysinitEx;
            _initEx = initEx;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java and 3 other locations - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01698TreePerformance.java on lines 67..72
zul/src/main/java/org/zkoss/zul/impl/GroupsListModel.java on lines 435..440
zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/ActionContextImpl.java on lines 38..43

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

    @Command("addTag")
    public void onAddTag(@BindingParam("form") Item form,
            @BindingParam("tagValue") String tagValue) {
        Map<String, Tag> tags = form.getTags();
        tags.put(tagValue, new Tag(tagValue));
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithMap.java on lines 83..89

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