Showing 2,934 of 7,758 total issues

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

    private List<MyItem> getListboxData() {
    ArrayList<MyItem> list = new ArrayList<>();
    listboxItemList = new ArrayList<>();
    for (int i = 0; i < 10000; i++) {
        list.add(new MyItem("a" + (10000 - i), B86_ZK_4020Composer.repeat("b", i % 5) + i, i));
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017ListboxComposer.java on lines 51..60
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4020Composer.java on lines 64..73

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

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 ListModelSet getModel(int config,int items) {
        ListModelSet model = null;
        if (config == CLONEABLE || config == MULTIPLE_AND_CLONEABLE)
            model = (ListModelSet)org.zkoss.zktest.util.Serializations.toCloneableListModelSet(getItems(items));
        else
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelArrays.java on lines 15..24
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelLists.java on lines 17..26
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelMaps.java on lines 17..26

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

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

    private List<MyItem> getGridData() {
        ArrayList<MyItem> list = new ArrayList<>();
        gridItemList = new ArrayList<>();
        for (int i = 0; i < 10000; i++) {
            list.add(new MyItem("a" + (10000 - i), B86_ZK_4020Composer.repeat("b", i % 5) + i, i));
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4017ListboxComposer.java on lines 51..60
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4020Composer.java on lines 75..84

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

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

    public static String toJSONString(float[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

    public static String toJSONString(char[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167

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

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

    public static String toJSONString(long[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

    public static String toJSONString(short[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

    public static String toJSONString(Object[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

        } else {
            Object[] data = (Object[]) obj;
            row.appendChild(new Listcell(data[0].toString()));
            row.appendChild(new Listcell(data[1].toString()));
            row.appendChild(new Listcell(data[2].toString()));
zktest/src/main/java/org/zkoss/zktest/test2/group/FoodGroupRenderer.java on lines 17..24

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

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

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

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

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

Refactorings

Further Reading

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

        if (tccl == null) {
            cacheValue = nullTcclFactory;
        } else {
            CacheKey key = new CacheKey(tccl);
            cacheValue = factoryCache.get(key);
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/ExpressionFactory.java and 1 other location - About 1 hr to fix
zel/src/main/java/org/zkoss/zel/Util.java on lines 101..113

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

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

    public static String toJSONString(double[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

        for (int j = begin; j < end; ++j) {
            final char cc = value.charAt(j);
            final String rep;
            switch (cc) {
            case '<': sb.append("&lt;"); break;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/xml/XMLs.java and 1 other location - About 1 hr to fix
zcommon/src/main/java/org/zkoss/xml/XMLs.java on lines 121..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 92.

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

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

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

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

Refactorings

Further Reading

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

    public Object setAttribute(String name, Object value, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_sess != null) {
                if (_sess.hasAttribute(name, true))
                    return _sess.setAttribute(name, value, true);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java and 1 other location - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 991..1002

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

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

    public static String toJSONString(int[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

        for (int j = 0; j < len; ++j) {
            final char cc = value.charAt(j);
            final String rep;
            switch (cc) {
            case '<': sb.append("&lt;"); break;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/xml/XMLs.java and 1 other location - About 1 hr to fix
zcommon/src/main/java/org/zkoss/xml/XMLs.java on lines 152..162

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

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

    public static String toJSONString(boolean[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 143..153
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

    public static String toJSONString(byte[] ary) {
        if (ary == null)
            return "null";

        final StringBuffer sb = new StringBuffer().append('[');
Severity: Major
Found in zcommon/src/main/java/org/zkoss/json/JSONArray.java and 8 other locations - About 1 hr to fix
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 59..69
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 73..83
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 87..97
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 101..111
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 115..125
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 129..139
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 157..167
zcommon/src/main/java/org/zkoss/json/JSONArray.java on lines 171..181

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

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

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

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

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

Refactorings

Further Reading

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

    public Object setAttribute(String name, Object value, boolean recurse) {
        if (recurse && !hasAttribute(name)) {
            if (_parent != null) {
                if (_parent.hasAttribute(name, true))
                    return _parent.setAttribute(name, value, true);
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 1 hr to fix
zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java on lines 735..746

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

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

        } else {
            Object[] data = (Object[]) obj;
            row.appendChild(new Label(data[0].toString()));
            row.appendChild(new Label(data[1].toString()));
            row.appendChild(new Label(data[2].toString()));
zktest/src/main/java/org/zkoss/zktest/test2/group/FoodGroupRenderer2.java on lines 17..24

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

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 void onChildRemoved(Component child) {
        super.onChildRemoved(child);
        if (_caption == child)
            _caption = null;
        else if (_tbar == child)
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Panel.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Borderlayout.java on lines 241..253

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

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