Showing 2,942 of 7,777 total issues

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

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

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

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

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

Refactorings

Further Reading

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

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

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/util/Maps.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/lang/Strings.java on lines 776..778

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

            } catch (Throwable ex) {
                if (errs != null)
                    errs.add(ex);
                if (!silent)
                    log.error("Failed to invoke " + fn, ex);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java on lines 569..574

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

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

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

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

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

Refactorings

Further Reading

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

        if (BigInteger.class.equals(type)) {
            try {
                return new BigInteger(val);
            } catch (NumberFormatException nfe) {
                throw new ELException(MessageFactory.get("error.convert",
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 1 other location - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 459..466

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 setSessionCache(SessionCache cache) {
        if (cache == null)
            throw new IllegalArgumentException();
        _sesscache.destroy(this);
        _sesscache = cache;
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 307..313

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 (!"auto".equals(mode) && !"instant".equals(mode) && !"defer".equals(mode))
                throw new WrongValueException("Unknown mode: " + mode);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Include.java and 3 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/Datebox.java on lines 1038..1039
zul/src/main/java/org/zkoss/zul/Splitter.java on lines 117..118
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 (url != null) {
                // prevent SSRF warning
                url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile());
                return url.openStream();
            }
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Servlets.java and 1 other location - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/AbstractExtendlet.java on lines 176..180

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 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 (annt != null && anntdis != null) {
            throw new UiException(
                    "don't use " + NotifyChange.class + " with " + NotifyChangeDisabled.class + ", choose only one");
        }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.java and 1 other location - About 30 mins to fix
zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.java on lines 141..144

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 1038..1039
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 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 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

                if (argType == null
                || (!bySubclass && mType.isAssignableFrom(argType))
                || (bySubclass && argType.isAssignableFrom(mType)))
                    continue; //match one argument
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/Classes.java and 1 other location - About 30 mins to fix
zcommon/src/main/java/org/zkoss/lang/Classes.java on lines 917..920

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