Showing 2,934 of 7,758 total issues

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

        } else if (o instanceof long[]) {
            final long[] ary = (long[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof char[]) {
            final char[] ary = (char[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof float[]) {
            final float[] ary = (float[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof double[]) {
            final double[] ary = (double[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof short[]) {
            final short[] ary = (short[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof int[]) {
            final int[] ary = (int[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 475..495
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455

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

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

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

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

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

Refactorings

Further Reading

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

        } else if (o instanceof byte[]) {
            final byte[] ary = (byte[]) o;
            _it = new Iterator() {
                private int _j = begin;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java and 6 other locations - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 535..555
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 515..535
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 495..515
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 455..475
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 435..455
zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java on lines 415..435

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

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 static class Food {
        private String Category;
        private String Name;

        public Food(String category, String name) {
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModel.java on lines 86..111

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

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 DefaultTreeModel<String> getTreeModel() {
        List<DefaultTreeNode<String>> children = new ArrayList<DefaultTreeNode<String>>();
        TreeNode<String> root = new DefaultTreeNode<String>("root", children);
        for (int i = 0; i < 10; i++) {
            root.getChildren().add(new DefaultTreeNode<String>("c" + i));
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2098_ViewModel.java on lines 18..27

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

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 static class Food {
        private String Category;
        private String Name;

        public Food(String category, String name) {
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00807GroupModel.java on lines 96..121

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

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 class FoodGroupInfo {
        private Food firstChild;
        private int groupIndex;
        private int columnIndex;
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 3967..3988
zktest/src/main/java/org/zkoss/zktest/test2/B85_ZK_3656VM.java on lines 54..78
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4028Item.java on lines 19..41

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

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 class Person {
        private String firstName;

        private String lastName;

zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 3967..3988
zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1998Composer.java on lines 104..127
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4028Item.java on lines 19..41

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

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

        _properties.put("context", new ObjectPropertyAccess() {
            public void setValue(Component cmp, Object context) {
                if (context instanceof Popup)
                    ((XulElement) cmp).setContext((Popup) context);
                else if (context != null)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 440..451
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 453..464

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

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

        _properties.put("tooltip", new ObjectPropertyAccess() {
            public void setValue(Component cmp, Object tooltip) {
                if (tooltip instanceof Popup)
                    ((XulElement) cmp).setTooltip((Popup) tooltip);
                else if (tooltip != null)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 428..439
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 440..451

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

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

        _properties.put("popup", new ObjectPropertyAccess() {
            public void setValue(Component cmp, Object popup) {
                if (popup instanceof Popup)
                    ((XulElement) cmp).setPopup((Popup) popup);
                else if (popup != null)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/XulElement.java and 2 other locations - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 428..439
zul/src/main/java/org/zkoss/zul/impl/XulElement.java on lines 453..464

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

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 DefaultTreeModel<String> getTreeModel() {
        List<DefaultTreeNode<String>> children = new ArrayList<DefaultTreeNode<String>>();
        TreeNode<String> root = new DefaultTreeNode<String>("root", children);
        for (int i = 0; i < 10; i++) {
            root.getChildren().add(new DefaultTreeNode<String>("c" + i));
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2096_ViewModel.java on lines 24..33

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

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 class F86_ZK_4028Item implements Serializable {
    private String text;
    private String iconClass;
    private String url;

zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 3967..3988
zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1998Composer.java on lines 104..127
zktest/src/main/java/org/zkoss/zktest/test2/B85_ZK_3656VM.java on lines 54..78

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

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 class TargetInfo implements java.io.Serializable {
        private final Object target;
        private final String event;
        private Object data;

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 3 other locations - About 1 hr to fix
zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1998Composer.java on lines 104..127
zktest/src/main/java/org/zkoss/zktest/test2/B85_ZK_3656VM.java on lines 54..78
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4028Item.java on lines 19..41

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

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

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

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

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

Refactorings

Further Reading

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

    public ListModelMapProxy(ListModelMap<K, V> origin, Annotation[] callerAnnots) {
        _origin = origin;
        _cache = new ListModelMapProxy<K, V>.MapForCache<>(origin.size());
        if (callerAnnots != null) {
            for (Annotation annot : callerAnnots) {
zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java on lines 54..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 73.

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

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

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

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

Refactorings

Further Reading

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

    public MapProxy(Map<K, V> origin, Annotation[] callerAnnots) {
        _origin = origin;
        _cache = new MapForCache<K, V>(origin.size());
        if (callerAnnots != null) {
            for (Annotation annot : callerAnnots) {
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/proxy/MapProxy.java and 1 other location - About 1 hr to fix
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelMapProxy.java on lines 57..69

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

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