Showing 2,934 of 7,758 total issues

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

    protected class ExtraCtrl extends XulElement.ExtraCtrl implements LoadStatus {
        //-- LoadStatus --//
        public boolean isLoaded() {
            return Row.this.isLoaded();
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Row.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Listitem.java on lines 432..445

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

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

    protected void fireEvent(int type, int groupIndex, int index0, int index1) {
        final GroupsDataEvent evt = new GroupsDataEvent(this, type, groupIndex, index0, index1);
        for (GroupsDataListener l : _listeners)
            l.onChange(evt);
    }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/AbstractGroupsModel.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 180..184

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

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=#set2")
    public void setM2() {
        ArrayList<String> list2 = new ArrayList<String>();
        list2.add("item1");
        ListModelList<String> listmodel2 = new ListModelList<String>(list2);
zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_3735Composer.java on lines 31..38

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

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

    protected class ExtraCtrl extends XulElement.ExtraCtrl implements LoadStatus {
        //-- LoadStatus --//
        public boolean isLoaded() {
            return Listitem.this.isLoaded();
        }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listitem.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Row.java on lines 373..386

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

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

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

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

        if (pkgFrom == null || pkgFrom.length() == 0 || pkgTo == null || pkgTo.length() == 0)
            throw new IllegalArgumentException();
zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.java on lines 877..878
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

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

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

        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

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

        } else         if (isLongOp(obj0, obj1)) {
            Long l0 = (Long) coerceToNumber(obj0, Long.class);
            Long l1 = (Long) coerceToNumber(obj1, Long.class);
            return Objects.equals(l0, l1);
        } else if (obj0 instanceof Boolean || obj1 instanceof Boolean) {
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 249..253
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

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 setAuDecoderClass(Class<?> cls) {
        if (cls != null && !AuDecoder.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("AuDecoder not implemented: " + cls);
        _audeccls = 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 1560..1564

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

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

        } else if (isDoubleOp(obj0, obj1)) {
            Double d0 = (Double) coerceToNumber(obj0, Double.class);
            Double d1 = (Double) coerceToNumber(obj1, Double.class);
            return Objects.equals(d0, d1);
        } else if (isBigIntegerOp(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 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

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

    public void setSessionCacheClass(Class<?> cls) {
        if (cls != null && !SessionCache.class.isAssignableFrom(cls))
            throw new IllegalArgumentException("SessionCache not implemented: " + cls);
        _sesscachecls = 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 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 (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 294..296
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 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

Severity
Category
Status
Source
Language