Showing 7,775 of 7,775 total issues

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

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

    public void setFileItemFactoryClass(Class<?> cls) {
        if (cls != null && !DiskFileItemFactory.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("DiskFileItemFactory not implemented: " + cls);
        _fileFactory = 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 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 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 4 locations. Consider refactoring.
Open

        } else if (isBigDecimalOp(obj0, obj1)) {
            BigDecimal bd0 = (BigDecimal) coerceToNumber(obj0, BigDecimal.class);
            BigDecimal bd1 = (BigDecimal) coerceToNumber(obj1, BigDecimal.class);
            return Objects.equals(bd0, bd1);
        } else if (isDoubleOp(obj0, obj1)) {
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 3 other locations - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 253..257
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 249..253
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.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 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 setFailoverManagerClass(Class<?> cls) {
        if (cls != null && !FailoverManager.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("FailoverManager not implemented: " + cls);
        _failmancls = 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 1473..1477
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

        for (int i = 1; i < columnNum; i++)
            treerow.appendChild(new Treecell("Cell " + rowNum + "-" + i));
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 103..104
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 108..109

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

        } else if (isBigIntegerOp(obj0, obj1)) {
            BigInteger bi0 = (BigInteger) coerceToNumber(obj0, BigInteger.class);
            BigInteger bi1 = (BigInteger) coerceToNumber(obj1, BigInteger.class);
            return Objects.equals(bi0, bi1);
        } else         if (isLongOp(obj0, obj1)) {
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 3 other locations - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 253..257
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 245..249
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 241..245

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 setIdGeneratorClass(Class<?> cls) {
        if (cls != null && !IdGenerator.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("IdGenerator not implemented: " + cls);
        _idgencls = 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 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 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

        for (int i = 1; i < columnNum; i++)
            listitem.appendChild(new Listcell("Cell " + rowNum + "-" + i));
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 103..104
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 114..115

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 setWebAppFactoryClass(Class<?> cls) {
        if (cls != null && !WebAppFactory.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("WebAppFactory not implemented: " + cls);
        _wappftycls = 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 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

        for (int i = 1; i < columnNum; i++)
            row.appendChild(new Label("Cell " + rowNum + "-" + i));
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 108..109
zktest/src/main/java/org/zkoss/zktest/test2/F86_ZK_4212Composer.java on lines 114..115

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

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

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/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 312..314

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 setTickFont(Font font) {
        if (!Objects.equals(font, _tickFont)) {
            _tickFont = font;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_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 163..168
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 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

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

Severity
Category
Status
Source
Language