Showing 7,775 of 7,775 total issues

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

    public void setColumns(int columns) {
        if (columns < 0)
            throw new WrongValueException("Positive only");
        if (_columns != columns) {
            _columns = columns;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Frozen.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 55..62
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 49..56
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 123..130
zul/src/main/java/org/zkoss/zul/Slider.java on lines 476..483
zul/src/main/java/org/zkoss/zul/Slider.java on lines 504..511

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

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

    public void setStrokeWidth(double strokeWidth) {
        if (strokeWidth <= 0)
            throw new WrongValueException("The value of strokeWidth should be larger than 0");
        if (_strokeWidth != strokeWidth) {
            _strokeWidth = strokeWidth;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Slider.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 55..62
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 49..56
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 70..77
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 123..130
zul/src/main/java/org/zkoss/zul/Slider.java on lines 504..511

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

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

    public void setScaleInput(double scaleInput) {
        if (_scaleInput <= 0)
            throw new WrongValueException("The value of scaleInput should be larger than 0");
        if (_scaleInput != scaleInput) {
            _scaleInput = scaleInput;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Slider.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 55..62
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 49..56
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 70..77
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 123..130
zul/src/main/java/org/zkoss/zul/Slider.java on lines 476..483

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

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

    public void setColspan(int colspan) throws WrongValueException {
        if (colspan <= 0)
            throw new WrongValueException("Positive only");
        if (_colspan != colspan) {
            _colspan = colspan;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Auxheader.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 49..56
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 70..77
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 123..130
zul/src/main/java/org/zkoss/zul/Slider.java on lines 476..483
zul/src/main/java/org/zkoss/zul/Slider.java on lines 504..511

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

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

    public void setRightColumns(int rightColumns) {
        if (rightColumns < 0)
            throw new WrongValueException("Positive only");
        if (_rightColumns != rightColumns) {
            _rightColumns = rightColumns;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Frozen.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 55..62
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 49..56
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 70..77
zul/src/main/java/org/zkoss/zul/Slider.java on lines 476..483
zul/src/main/java/org/zkoss/zul/Slider.java on lines 504..511

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

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

    public void setStart(int start) {
        if (start < 0)
            throw new WrongValueException("Positive only");
        if (_start != start) {
            _start = start;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Frozen.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 55..62
zul/src/main/java/org/zkoss/zul/Auxheader.java on lines 74..81
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 70..77
zul/src/main/java/org/zkoss/zul/Frozen.java on lines 123..130
zul/src/main/java/org/zkoss/zul/Slider.java on lines 476..483
zul/src/main/java/org/zkoss/zul/Slider.java on lines 504..511

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

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

    public void setTabbable(boolean tabbable) {
        if ((_auxinf != null && _auxinf.tabbable) != tabbable) {
            initAuxInfoForTextbox().tabbable = tabbable;
            smartUpdate("tabbable", isTabbable());
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Textbox.java and 9 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/A.java on lines 59..64
zul/src/main/java/org/zkoss/zul/Button.java on lines 64..69
zul/src/main/java/org/zkoss/zul/Label.java on lines 95..100
zul/src/main/java/org/zkoss/zul/Label.java on lines 120..125
zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 71..76
zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 86..91
zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 192..197
zul/src/main/java/org/zkoss/zul/Textbox.java on lines 152..157
zul/src/main/java/org/zkoss/zul/Textbox.java on lines 199..204

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

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

        private static final Type LONG_TYPE = new Type(LONG, null, ('J' << 24)
            | (1 << 16) | (1 << 8) | 2, 1);
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 899..900
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 905..906
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 911..912
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 917..918
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 923..924
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 929..930
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 935..936
zkbind/src/main/java/org/zkoss/bind/paranamer/BytecodeReadingParanamer.java on lines 947..948

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

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

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

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

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

Refactorings

Further Reading

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

            if (min >= 0)
                max = min + cnt - 1;
            else if (max < 0)
                max = cnt - 1; //0 ~ cnt - 1
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java and 2 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Combobox.java on lines 320..323
zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java on lines 158..161

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

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 (df instanceof SimpleDateFormat) {
            final String fmt = ((SimpleDateFormat)df).toPattern();
            if (fmt != null && !"M/d/yy h:mm a".equals(fmt))
                return fmt; // note: JVM use "M/d/yy h:mm a" if not found!
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/text/DateFormats.java and 1 other location - About 35 mins to fix
zcommon/src/main/java/org/zkoss/text/DateFormats.java on lines 133..137

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

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

    public String setUnavailableMessage(String msg) {
        final String old = _uamsg;
        _uamsg = msg != null && msg.length() > 0 ? msg : null;
        return old;
    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/device/GenericDevice.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/device/Devices.java on lines 474..478

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

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 (offset < 0 || offset > textLen) {
            throw new IllegalArgumentException(
                    "Invalid (offset, len). offset=" + offset + ", len=" + len + ", text.length=" + textLen);
        }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.java and 1 other location - About 35 mins to fix
zcommon/src/main/java/org/zkoss/lang/JavaScriptEscape.java on lines 611..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 44.

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 (NamespaceParser nsParser : _nsParsers) {
                                    if (nsParser.isMatched(attURI)) {
                                        if (nsParser.parse(attr, compInfo, pgdef)) {
                                            handled = true;
                                            break;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java on lines 954..961

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

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 (init instanceof InitiatorExt) {
                        try {
                            if (((InitiatorExt) init).doCatch(t))
                                return true;
                        } catch (Throwable ex) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java on lines 151..158

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

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 (vars != null) {
            _vars = new LinkedHashMap<String, Object>();
            for (Map.Entry<String, String> me : vars.entrySet()) {
                _vars.put(me.getKey(), Utils.parseComposite(me.getValue(), Object.class, _composite));
            }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/VariablesInfo.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/AttributesInfo.java on lines 69..74

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

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

        public String setUnavailableMessage(String msg) {
            final String old = _uamsg;
            _uamsg = msg != null && msg.length() > 0 ? msg : null;
            return old;
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/device/Devices.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/device/GenericDevice.java on lines 59..63

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

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

    public void setExpressionFactoryClass(Class<? extends ExpressionFactory> expfcls) {
        if (expfcls != null && !ExpressionFactory.class.isAssignableFrom(expfcls))
            throw new IllegalArgumentException(expfcls + " must implement " + ExpressionFactory.class);
        _expfcls = expfcls;
    }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java and 1 other location - About 35 mins to fix
zcommon/src/main/java/org/zkoss/xel/Expressions.java on lines 170..174

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

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

        synchronized (map) {
            List<EventProcessingThreadImpl> list = map.get(mutex);
            if (list == null)
                map.put(mutex, list = new LinkedList<EventProcessingThreadImpl>());
            list.add(evtthd);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/WebManager.java on lines 440..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 44.

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 (attrs != null && !attrs.isEmpty()) {
            _attrs = new LinkedHashMap<String, Object>();
            for (Map.Entry<String, String> me : attrs.entrySet()) {
                _attrs.put(me.getKey(), Utils.parseComposite(me.getValue(), Object.class, _composite));
            }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AttributesInfo.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/VariablesInfo.java on lines 63..68

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

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 (initAuxInfo().evthds == null) {
                _auxinf.evthds = evthds;
                _auxinf.evthdsShared = true;
            } else {
                _auxinf.evthds.addAll(evthds);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 2830..2835

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

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