Showing 2,934 of 7,758 total issues

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

    public void setUiFactoryClass(Class<?> cls) {
        if (cls != null && !UiFactory.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("UiFactory not implemented: " + cls);
        _uiftycls = cls;
    }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

            if (min < 0)
                if (max < 0)
                    min = 0;
                else
                    min = max - cnt + 1;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java and 2 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Combobox.java on lines 276..280
zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java on lines 130..134

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

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

            if (min < 0)
                if (max < 0)
                    min = 0;
                else
                    min = max - cnt + 1;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java and 2 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Combobox.java on lines 276..280
zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java on lines 120..124

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

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

        if (browser == Browser.Firefox || browser == Browser.WebKit) {
            sb.append("\t display:\t").append(browser.getPrefix()).append("box;\n");
        }
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/fn/ThemeFns.java and 2 other locations - About 30 mins to fix
zweb/src/main/java/org/zkoss/web/fn/ThemeFns.java on lines 278..280
zweb/src/main/java/org/zkoss/web/fn/ThemeFns.java on lines 294..296

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

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 void setUiEngineClass(Class<?> cls) {
        if (cls != null && !UiEngine.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("UiEngine not implemented: " + cls);
        _uiengcls = cls;
    }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1452..1456
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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

                        if (min < 0)
                            if (max < 0)
                                min = 0;
                            else
                                min = max - cnt + 1;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java and 2 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java on lines 120..124
zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java on lines 130..134

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

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

            if (name == null || name.length() == 0 || prop == null || prop.length() == 0)
                throw new IllegalArgumentException();
zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java on lines 826..827
zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java on lines 877..878

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

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

        if (name == null || name.length() == 0 || version == null || version.length() == 0)
            throw new IllegalArgumentException();
zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java on lines 826..827
zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java on lines 1141..1142

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

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 void setDesktopCacheProviderClass(Class<?> cls) {
        if (cls != null && !DesktopCacheProvider.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("DesktopCacheProvider not implemented: " + cls);
        _dcpcls = cls;
    }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 8 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1385..1389
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1429..1433
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1473..1477
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1494..1498
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1516..1520
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1539..1543
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1560..1564
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 1583..1587

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

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 PageDefinition getPageDefinitionDirectly(WebApp wapp, Reader reader, String extension) throws IOException {
        final CCInfo cci = beforeCC(wapp);
        try {
            return cci.exec.getPageDefinitionDirectly(reader, extension);
        } finally {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 218..225
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 254..261
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 558..565
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 590..597

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

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 setTextFont(Font font) {
        if (!Objects.equals(font, _textFont)) {
            _textFont = font;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_FONT, font);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

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 Component[] createComponents(WebApp wapp, PageDefinition pagedef, Map<?, ?> arg) {
        final CCInfo cci = beforeCC(wapp);
        try {
            return cci.exec.createComponents(pagedef, arg);
        } finally {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 254..261
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 558..565
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 590..597
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 623..630

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

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 setText(String text) {
        if (!Objects.equals(text, _text)) {
            _text = text;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_TEXT, text);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

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 PageDefinition getPageDefinitionDirectly(WebApp wapp, String content, String extension) {
        final CCInfo cci = beforeCC(wapp);
        try {
            return cci.exec.getPageDefinitionDirectly(content, extension);
        } finally {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 218..225
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 254..261
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 590..597
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 623..630

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

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 setValueFont(Font font) {
        if (!Objects.equals(font, _valueFont)) {
            _valueFont = font;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_FONT, font);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

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 Component[] createComponents(WebApp wapp, String uri, Map<?, ?> arg) {
        final CCInfo cci = beforeCC(wapp);
        try {
            return cci.exec.createComponents(uri, arg);
        } finally {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 218..225
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 558..565
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 590..597
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 623..630

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

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 PageDefinition getPageDefinitionDirectly(WebApp wapp, Document content, String extension) {
        final CCInfo cci = beforeCC(wapp);
        try {
            return cci.exec.getPageDefinitionDirectly(content, extension);
        } finally {
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/Executions.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 218..225
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 254..261
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 558..565
zk/src/main/java/org/zkoss/zk/ui/Executions.java on lines 623..630

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

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 (argType == null
                || (!bySubclass && mType.isAssignableFrom(argType))
                || (bySubclass && argType.isAssignableFrom(mType)))
                    continue; //match
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/lang/Classes.java on lines 989..992

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

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 (this.eden.size() >= size) {
            synchronized (longterm) {
                this.longterm.putAll(this.eden);
            }
            this.eden.clear();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/util/ConcurrentCache.java and 1 other location - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/util/ConcurrentCache.java on lines 71..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 40.

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

        try {
            uploadClass = Class.forName(JAVAX_UPLOAD_CLASS);
        } catch (ClassNotFoundException ex0) {
            try {
                uploadClass = Class.forName(JAKARTA_UPLOAD_CLASS);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.java on lines 102..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 40.

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