Showing 7,775 of 7,775 total issues

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

        if ((v = node?.clientWidth) && ofs[0] > (v + zkn.sumStyles('l', jqBorders)) && ofs[0] < (node.offsetWidth - zkn.sumStyles('r', jqBorders))
Severity: Major
Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/drag.ts on lines 839..839

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

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

        || (v = node?.clientHeight) && ofs[1] > (v + zkn.sumStyles('t', jqBorders)) && ofs[1] < (node.offsetHeight - zkn.sumStyles('b', jqBorders))) //scrollbar
Severity: Major
Found in zk/src/main/resources/web/js/zk/drag.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/drag.ts on lines 838..838

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

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 ListModelList getModel(int config,int items) {
        ListModelList model = null;
        if (config == CLONEABLE || config == MULTIPLE_AND_CLONEABLE)
            model = (ListModelList)org.zkoss.zktest.util.Serializations.toCloneableListModelList(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/ListModelMaps.java on lines 17..26
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelSets.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 4 locations. Consider refactoring.
Open

    public static ListModelMap getModel(int config,int amount) {
        ListModelMap model = null;
        if (config == CLONEABLE || config == MULTIPLE_AND_CLONEABLE)
            model = (ListModelMap)org.zkoss.zktest.util.Serializations.toCloneableListModelMap(getItems(amount));
        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/ListModelSets.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

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

    protected void renderPage(Execution exec, Page page, Writer out, boolean au)
            throws IOException {
        if (!au) {
            out.write(HtmlPageRenders.outLangStyleSheets(exec, null, null));
            out.write(HtmlPageRenders.outLangJavaScripts(exec, null, null));
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/impl/PageRenderer.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/impl/PageRenderer.java on lines 135..144

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

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

    protected void renderPage(Execution exec, Page page, Writer out, boolean au) throws IOException {
        if (!au) {
            out.write(HtmlPageRenders.outLangStyleSheets(exec, null, null));
            out.write(HtmlPageRenders.outLangJavaScripts(exec, null, null));
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/impl/PageRenderer.java and 1 other location - About 1 hr to fix
zhtml/src/main/java/org/zkoss/zhtml/impl/PageRenderer.java on lines 100..110

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 ListModelArray getModel(int config,int items) {
        ListModelArray model = null;
        if (config == CLONEABLE || config == MULTIPLE_AND_CLONEABLE)
            model = (ListModelArray)org.zkoss.zktest.util.Serializations.toCloneableListModelAraay(getItems(items));
        else
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
zktest/src/main/java/org/zkoss/zktest/test2/select/models/ListModelSets.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 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<B86_ZK_4017MyItem> getData() {
        ArrayList<B86_ZK_4017MyItem> list = new ArrayList<>();
        itemList = new ArrayList<>();
        for (int i = 0; i < 1000; i++) {
            list.add(new B86_ZK_4017MyItem("a" + (1000 - i), B86_ZK_4017Composer.repeat("b", i % 5) + i, i));
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4020Composer.java on lines 64..73
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 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 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

Method newSavePropertyBinding has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected SavePropertyBinding newSavePropertyBinding(Component comp, String attr, String saveAttr, String saveExpr,
            ConditionType conditionType, String command, Map<String, Object> bindingArgs, String converterExpr,
            Map<String, Object> converterArgs, String validatorExpr, Map<String, Object> validatorArgs) {
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

    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

    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

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

        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

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

    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

    Severity
    Category
    Status
    Source
    Language