Showing 7,775 of 7,775 total issues

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 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 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 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 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 void setNeedleType(String type) {
        if (!Objects.equals(_needleType, type)) {
            _needleType = type;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.NEEDLE_TYPE, type);
        }
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 295..300

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

    private static final char getEndingParenthesis(char cc) {
        return cc == '{' ? '}': cc == '(' ? ')': cc == '[' ? ']': (char)0;
    }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Strings.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/util/Maps.java on lines 612..614

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 (forEach == null) {
                    if (childInfo.isEffective(comp)) {
                        getNativeFirstHalf(ci, sb, comp, childInfo, helper);
                        getNativeSecondHalf(ci, sb, comp, childInfo, helper);
                    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java on lines 2281..2286

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 (!(_renderer instanceof RowRendererExt)
                    || (((RowRendererExt) _renderer).getControls() & RowRendererExt.DETACH_ON_RENDER) != 0) { //detach (default)
                cell.detach();
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2744..2748

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

        if (!"start".equals(align) && !"center".equals(align) && !"end".equals(align))
            throw new WrongValueException("align cannot be " + align);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Toolbar.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Datebox.java on lines 1039..1040
zul/src/main/java/org/zkoss/zul/Include.java on lines 328..329
zul/src/main/java/org/zkoss/zul/Splitter.java on lines 117..118

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

        else if (!"none".equals(collapse) && !"before".equals(collapse) && !"after".equals(collapse))
            throw new WrongValueException("Unknown collpase: " + collapse);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Splitter.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Datebox.java on lines 1039..1040
zul/src/main/java/org/zkoss/zul/Include.java on lines 328..329
zul/src/main/java/org/zkoss/zul/Toolbar.java on lines 74..75

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 (feature.startsWith("http://xml.org"))
                log.warn("Ignored: "+fty+" doesn't support "+feature+". Cause: "+Exceptions.getMessage(ex));
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/idom/input/SAXBuilder.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/idom/input/SAXBuilder.java on lines 399..400

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

    public void setDesktopCacheProvider(DesktopCacheProvider provider) {
        if (provider == null)
            throw new IllegalArgumentException();
        _provider.stop(this);
        _provider = provider;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 279..285
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 307..313
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 339..345

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

    public void setUiFactory(UiFactory factory) {
        if (factory == null)
            throw new IllegalArgumentException();
        _factory.stop(this);
        _factory = factory;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 3 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 279..285
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 295..301
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 339..345

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

            final ComponentDefinition compdef = pgdef != null ? pgdef.getComponentDefinition(cls, true)
                    : page != null ? page.getComponentDefinition(cls, true) : null;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Impls.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 2709..2710

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

                            for (int i = max + 1, j = comboitems.size(); i < j && iterator.hasNext(); start++) {
                                if (start < i) {
                                    iterator.next();
                                    continue;
                                }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Combobox.java on lines 347..353

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 (!(_renderer instanceof ListitemRendererExt)
                    || (((ListitemRendererExt) _renderer).getControls() & ListitemRendererExt.DETACH_ON_RENDER) != 0) { // detach
                // (default)
                cell.detach();
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1185..1188

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 (min < 0)
                min = 0;
            else if (min > oldsz - 1)
                min = oldsz - 1;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java and 1 other location - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java on lines 416..419

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 {
            diskUploadClass = Class.forName(JAVAX_DISK_UPLOAD_CLASS);
        } catch (ClassNotFoundException ex0) {
            try {
                diskUploadClass = Class.forName(JAKARTA_DISK_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 92..100

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