Showing 2,934 of 7,758 total issues

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

                case 1:
                    k = 30 * this._intval(l / 3) + this._intval((g - 1) / 3);
                    break;
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js and 1 other location - About 40 mins to fix
zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js on lines 967..970

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

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

    try {
        n.select();
    } catch (e) {
        zk.debugLog((e as Error).message ?? e);
    }
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts and 1 other location - About 40 mins to fix
zk/src/main/resources/web/js/zk/pkg.ts on lines 76..80

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

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

                for (var c in code as Record<number | string, string>)
                    zAu.setErrorURI(parseInt(c), code[c] as string);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/au.ts and 1 other location - About 40 mins to fix
zk/src/main/resources/web/js/zk/au.ts on lines 537..538

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

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

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

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

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

Refactorings

Further Reading

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

    private void removePagingListener(Paginal pgi) {
        if (_model instanceof PageableModel) {
            ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
        }
        pgi.removeEventListener(ZulEvents.ON_PAGING, _pgListener);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 691..697
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1373..1379

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

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

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

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

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

Refactorings

Further Reading

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

    private void removePagingListener(Paginal pgi) {
        if (_model instanceof PageableModel) {
            ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
        }
        pgi.removeEventListener(ZulEvents.ON_PAGING, _pgListener);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 691..697
zul/src/main/java/org/zkoss/zul/Tree.java on lines 673..679

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

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

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

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

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

Refactorings

Further Reading

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

    private void removePagingListener(Paginal pgi) {
        if (_model instanceof PageableModel) {
            ((PageableModel) _model).removePagingEventListener((PagingListener) _pgListener);
        }
        pgi.removeEventListener(ZulEvents.ON_PAGING, _pgListener);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1373..1379
zul/src/main/java/org/zkoss/zul/Tree.java on lines 673..679

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

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

    public static class Data {
        private String template;
        public Data() {
        }

Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4686VM.java and 5 other locations - About 40 mins to fix
zktest/src/main/java/org/zkoss/zktest/bind/basic/AllFunctionVM.java on lines 75..93
zktest/src/main/java/org/zkoss/zktest/bind/basic/FormDirty.java on lines 8..23
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00905FormNotifyChange.java on lines 25..39
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01848FormBindingUpdate.java on lines 49..65
zktest/src/main/java/org/zkoss/zktest/bind/issue/B02083FormRef.java on lines 61..76

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

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

    public static class Product {
        private Item item;
        
        public Product() {}

zktest/src/main/java/org/zkoss/zktest/bind/basic/AllFunctionVM.java on lines 75..93
zktest/src/main/java/org/zkoss/zktest/bind/basic/FormDirty.java on lines 8..23
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00905FormNotifyChange.java on lines 25..39
zktest/src/main/java/org/zkoss/zktest/bind/issue/B02083FormRef.java on lines 61..76
zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4686VM.java on lines 61..77

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

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

    static public class Person {
        String name;
        public Person() {}
        public Person(String name) {
            this.name = name;
zktest/src/main/java/org/zkoss/zktest/bind/basic/AllFunctionVM.java on lines 75..93
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00905FormNotifyChange.java on lines 25..39
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01848FormBindingUpdate.java on lines 49..65
zktest/src/main/java/org/zkoss/zktest/bind/issue/B02083FormRef.java on lines 61..76
zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4686VM.java on lines 61..77

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

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

    static public class Element {
        String name;

        // An empty constructor is needed for FormProxy
        public Element() {
zktest/src/main/java/org/zkoss/zktest/bind/basic/FormDirty.java on lines 8..23
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00905FormNotifyChange.java on lines 25..39
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01848FormBindingUpdate.java on lines 49..65
zktest/src/main/java/org/zkoss/zktest/bind/issue/B02083FormRef.java on lines 61..76
zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4686VM.java on lines 61..77

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

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

    public static class Person {
        private String name;
        public Person() {}
        public Person(String name) {
            this.name = name;
zktest/src/main/java/org/zkoss/zktest/bind/basic/AllFunctionVM.java on lines 75..93
zktest/src/main/java/org/zkoss/zktest/bind/basic/FormDirty.java on lines 8..23
zktest/src/main/java/org/zkoss/zktest/bind/issue/B01848FormBindingUpdate.java on lines 49..65
zktest/src/main/java/org/zkoss/zktest/bind/issue/B02083FormRef.java on lines 61..76
zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4686VM.java on lines 61..77

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

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

    public void setInnerWidth(String innerWidth) {
        if (innerWidth == null)
            innerWidth = "100%";
        if (!_innerWidth.equals(innerWidth)) {
            _innerWidth = innerWidth;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 4 other locations - About 40 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/impl/ContentTag.java on lines 53..60
zul/src/main/java/org/zkoss/zul/Iframe.java on lines 71..78
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 598..605
zul/src/main/java/org/zkoss/zul/Tree.java on lines 921..928

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

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

    public static final String getOriginContextPath(ServletRequest request) {
        String path = (String) request.getAttribute(Attributes.FORWARD_CONTEXT_PATH);
        return path != null ? path
                : request instanceof HttpServletRequest ? ((HttpServletRequest) request).getContextPath() : "";
    }
Severity: Major
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java and 4 other locations - About 40 mins to fix
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 175..179
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 187..191
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 233..237
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 244..248

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

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

    public static final String getOriginRequestURI(ServletRequest request) {
        String path = (String) request.getAttribute(Attributes.FORWARD_REQUEST_URI);
        return path != null ? path
                : request instanceof HttpServletRequest ? ((HttpServletRequest) request).getRequestURI() : "/";
    }
Severity: Major
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java and 4 other locations - About 40 mins to fix
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 175..179
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 187..191
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 223..227
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 233..237

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

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

        case NEXT:
            old = se._nextInsertion;
            se._nextInsertion = target;
            if (old instanceof HtmlShadowElement) {
                asShadow(old)._previousInsertion = target;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java and 1 other location - About 40 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java on lines 1151..1157

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

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 (Iterator it = ((List) value).iterator(); it.hasNext(); j++) {
                if (j > 0)
                    buf.append(',');
                renderValue(it.next());
            }
zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 245..249

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

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 (border == null || "0".equals(border) || "false".equals(border))
            border = "none";
        else if ("true".equals(border))
            border = "normal";
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Panel.java and 1 other location - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Window.java on lines 360..363

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

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

    public void setContent(String content) {
        if (content == null)
            content = "";
        if (!content.equals(_content)) {
            _content = content;
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/impl/ContentTag.java and 4 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1000..1007
zul/src/main/java/org/zkoss/zul/Iframe.java on lines 71..78
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 598..605
zul/src/main/java/org/zkoss/zul/Tree.java on lines 921..928

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

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

    public void setInnerWidth(String innerWidth) {
        if (innerWidth == null)
            innerWidth = "100%";
        if (!_innerWidth.equals(innerWidth)) {
            _innerWidth = innerWidth;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 4 other locations - About 40 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/impl/ContentTag.java on lines 53..60
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1000..1007
zul/src/main/java/org/zkoss/zul/Iframe.java on lines 71..78
zul/src/main/java/org/zkoss/zul/Tree.java on lines 921..928

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

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 void setLeft(String left) {
        if (!Objects.equals(_auxinf != null ? _auxinf.left : null, left)) {
            initAuxInfo0().left = left;
            smartUpdate("left", left);
        }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java and 3 other locations - About 40 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 118..123
zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 105..110
zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 147..152

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

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