Showing 2,935 of 7,775 total issues

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

    public static Class<?>[] toTypeArray(String[] s) throws ClassNotFoundException {
        if (s == null)
            return null;
        Class<?>[] c = new Class[s.length];
        for (int i = 0; i < s.length; i++) {
zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.java on lines 121..129

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

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

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

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

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

Refactorings

Further Reading

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

    public Object[] getFieldValues(String key) {
        List<Message> keyMsgs = _keyMsgsMap.get(key);
        if (keyMsgs == null || keyMsgs.size() == 0) {
            return EMPTY_OBJECT_ARRAY;
        }
zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 301..310

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

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

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

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

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

Refactorings

Further Reading

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

    public void setOrient(String orient) throws WrongValueException {
        if (!HORIZONTAL.equals(orient) && !"vertical".equals(orient))
            throw new WrongValueException(orient);

        if (!Objects.equals(_auxinf != null ? _auxinf.orient : HORIZONTAL, orient)) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Button.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Button.java on lines 123..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 74.

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

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

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

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

Refactorings

Further Reading

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

            if (_map instanceof LinkedHashMap || _map instanceof SortedMap) {
                return removePartial(_col, c, true, false, true);
            } else { //bug #1839634 Problem while using HashSet with Databinding
                removeAllSelection(c);
                final boolean ret = _col.removeAll(c);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 808..817

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

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

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 3978..3999
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

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

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 3978..3999
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

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 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 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 3978..3999
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 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

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

Severity
Category
Status
Source
Language