Showing 2,934 of 7,758 total issues

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

    public ServerPush newServerPush(Desktop desktop, Class klass) {
        if (!ServerPush.class.isAssignableFrom(klass))
            throw new UiException(klass + " must implement " + ServerPush.class);
        try {
            return (ServerPush) klass.newInstance();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractUiFactory.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractUiFactory.java on lines 172..180

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

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

/* AuInsertBefore.java

    Purpose:
        
    Description:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/out/AuInsertBefore.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/au/out/AuInsertAfter.java on lines 1..54

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

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

/* AuInsertAfter.java

    Purpose:
        
    Description:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/out/AuInsertAfter.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/au/out/AuInsertBefore.java on lines 1..52

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

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

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

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

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

Refactorings

Further Reading

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

    public Composer newComposer(Page page, Class klass) {
        if (!Composer.class.isAssignableFrom(klass))
            throw new UiException(klass + " must implement " + Composer.class);
        try {
            return (Composer) klass.newInstance();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractUiFactory.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractUiFactory.java on lines 195..203

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

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

    @Listen("onClick=#addAfterLast")
    public void addAfterLast() {
        List<ShadowElement> roots = getSelf().getShadowRoots();
        HtmlShadowElement se = (HtmlShadowElement)roots.get(0);
        Label label = new Label();
zktest/src/main/java/org/zkoss/zktest/zats/zuti/composer/ShadowComposer.java on lines 129..136

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

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

    @Listen("onClick=#addAfterFirst")
    public void addAfterFirst() {
        List<ShadowElement> roots = getSelf().getShadowRoots();
        HtmlShadowElement se = (HtmlShadowElement)roots.get(0);
        Label label = new Label();
zktest/src/main/java/org/zkoss/zktest/zats/zuti/composer/ShadowComposer.java on lines 147..154

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

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

/* ForwardEvent.java

    Purpose:
        
    Description:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/ForwardEvent.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/event/FulfillEvent.java on lines 1..56

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

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

/* FulfillEvent.java

    Purpose:
        
    Description:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/FulfillEvent.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/event/ForwardEvent.java on lines 1..56

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

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

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

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

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

Refactorings

Further Reading

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

                            if (!elem[zk.Widget._TARGET]) {
                                elem[zk.Widget._TARGET] = elem[zk.Widget._CURRENT_TARGET];
                                delete elem[zk.Widget._CURRENT_TARGET];
                            }
Severity: Minor
Found in zk/src/main/resources/web/js/zk/ext/jquery.js and 1 other location - About 50 mins to fix
zk/src/main/resources/web/js/zk/ext/jquery.js on lines 3592..3595

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

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 {
                        tsdocConfigFile.configureParser(tsdocConfig);
                    } catch (e) {
                        context.report({
                            loc: topOfFile,
Severity: Minor
Found in eslint-plugin-zk/src/rules/tsdocValidation.ts and 1 other location - About 50 mins to fix
eslint-plugin-zk/src/rules/tsdocValidation.ts on lines 189..217

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

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

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

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

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

Refactorings

Further Reading

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

                        if (cur[zk.Widget._CURRENT_TARGET]) {
                            cur[zk.Widget._TARGET] = cur[zk.Widget._CURRENT_TARGET];
                            delete cur[zk.Widget._CURRENT_TARGET];
                        }
Severity: Minor
Found in zk/src/main/resources/web/js/zk/ext/jquery.js and 1 other location - About 50 mins to fix
zk/src/main/resources/web/js/zk/ext/jquery.js on lines 2996..2999

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

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 {
                const tsdocConfigFile = getForSourceFile(context.getFilename());
                if (!tsdocConfigFile.fileNotFound) {
                    if (tsdocConfigFile.hasErrors) {
                        throw Error(`\n${tsdocConfigFile.getErrorSummary()}`);
Severity: Minor
Found in eslint-plugin-zk/src/rules/tsdocValidation.ts and 1 other location - About 50 mins to fix
eslint-plugin-zk/src/rules/tsdocValidation.ts on lines 195..206

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

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

    public void setName(String name) {
        if (name != null && name.length() == 0)
            name = null;
        if (!Objects.equals(_name, name)) {
            _name = name;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Checkbox.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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

    public void setName(String name) {
        if (name != null && name.length() == 0)
            name = null;
        if (!Objects.equals(_name, name)) {
            _name = name;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Calendar.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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

    public void setOddRowSclass(String scls) {
        if (scls != null && scls.length() == 0)
            scls = null;
        if (!Objects.equals(_scOddRow, scls)) {
            _scOddRow = scls;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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

    public void setPackages(String packages) {
        if (packages != null && packages.length() == 0)
            packages = null;

        if (!Objects.equals(_packages, packages)) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Script.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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

    static public class Node{
        List<Node> children;
        String name;
        
        public Node(String name){
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenComplexVM.java on lines 50..71
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenMenuVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/databinding/childrenbinding/ChildrenNavVM.java on lines 47..68
zktest/src/main/java/org/zkoss/zktest/bind/parser/F80_Parser_StoreSubAnnotCntVM.java on lines 110..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 60.

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

        LabelImageElement[] lies = new LabelImageElement[] {a, auxheader, column, footer, button, caption, checkbox, combobutton, comboitem, fileupload, listheader, listcell, listfooter, menu, menuitem, nav, navitem, orgnode, radio, tab, toolbarbutton, treecol, treecell, treefooter};
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 95..95
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 104..104
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 113..113
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_5503_Composer.java on lines 122..122

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

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

    public void setName(String name) {
        if (name != null && name.length() == 0)
            name = null;
        if (!Objects.equals(_name, name)) {
            _name = name;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tabbox.java on lines 403..411
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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

    public void setPanelSpacing(String panelSpacing) {
        if (panelSpacing != null && panelSpacing.length() == 0)
            panelSpacing = null;

        if (!Objects.equals(_panelSpacing, panelSpacing)) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tabbox.java and 18 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlBasedComponent.java on lines 323..330
zul/src/main/java/org/zkoss/zul/Area.java on lines 110..117
zul/src/main/java/org/zkoss/zul/Box.java on lines 129..136
zul/src/main/java/org/zkoss/zul/Box.java on lines 185..192
zul/src/main/java/org/zkoss/zul/Box.java on lines 250..257
zul/src/main/java/org/zkoss/zul/Calendar.java on lines 237..244
zul/src/main/java/org/zkoss/zul/Checkbox.java on lines 225..232
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1332..1339
zul/src/main/java/org/zkoss/zul/Layout.java on lines 40..47
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 827..834
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1483..1490
zul/src/main/java/org/zkoss/zul/Radiogroup.java on lines 276..283
zul/src/main/java/org/zkoss/zul/Script.java on lines 105..113
zul/src/main/java/org/zkoss/zul/Script.java on lines 211..219
zul/src/main/java/org/zkoss/zul/Selectbox.java on lines 191..198
zul/src/main/java/org/zkoss/zul/Slider.java on lines 375..382
zul/src/main/java/org/zkoss/zul/Style.java on lines 119..126
zul/src/main/java/org/zkoss/zul/Tree.java on lines 819..826

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

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