Showing 2,934 of 7,758 total issues

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

    public class MaturityIndicator implements Converter {

        public Object coerceToUi(Object val, Component component, BindContext ctx) {

            Integer age = (Integer)val;
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 60..73
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 57..70
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va04.java on lines 60..73
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 156..169
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 89..102

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

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

    public class MaturityIndicator implements Converter {

        public Object coerceToUi(Object val, Component component, BindContext ctx) {

            Integer age = (Integer)val;
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va01.java on lines 60..73
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va02.java on lines 57..70
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va03.java on lines 50..63
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 156..169
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va11.java on lines 89..102

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

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

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

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

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

Refactorings

Further Reading

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

    protected <T extends Object> T createProxyObject(T t) {
        T p = isImmutableElements ? t : ProxyHelper.createProxyIfAny(t);
        if (p instanceof FormProxyObject)
            ((FormProxyObject) p).setPath("[$INDEX$]", _node);
        return p;
zkbind/src/main/java/org/zkoss/bind/proxy/AbstractCollectionProxy.java on lines 268..273
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.java on lines 511..516
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelSetProxy.java on lines 441..446

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

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 (cls != null) {
            try {
                _failover = (FailoverManager) cls.newInstance();
            } catch (Exception ex) {
                throw UiException.Aide.wrap(ex, "Unable to construct " + cls);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java and 2 other locations - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 179..185
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 199..205

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

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

        } catch (Throwable ex) {
            final IOException ioex = getIOException(ex);
            if (ioex == null)
                throw SystemException.Aide.wrap(ex);
            log.warn("Unable to load " + path, ioex);
zweb/src/main/java/org/zkoss/web/util/resource/ResourceCaches.java on lines 104..109
zweb/src/main/java/org/zkoss/web/util/resource/ResourceCaches.java on lines 126..131

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

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 setMinheight(int minheight) {
        if (minheight < 0)
            minheight = 100;
        if (_minheight != minheight) {
            _minheight = minheight;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Panel.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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 setMaxlength(int maxlength) {
        if (maxlength < 0)
            maxlength = 0;
        if (_maxlength != maxlength) {
            _maxlength = maxlength;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listheader.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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 setMaxlength(int maxlength) {
        if (maxlength < 0)
            maxlength = 0;
        if (_maxlength != maxlength) {
            _maxlength = maxlength;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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 setMinwidth(int minwidth) {
        if (minwidth < 0)
            minwidth = 200;
        if (_minwidth != minwidth) {
            _minwidth = minwidth;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Panel.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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

    private static Label newRenderLabel(String value) {
        final Label label = new Label(value != null && value.length() > 0 ? value : " ");
        label.setPre(true); //to make sure &nbsp; is generated, and then occupies some space
        return label;
    }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java and 2 other locations - About 35 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/BindRowRenderer.java on lines 143..147
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1159..1163

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

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 setMinheight(int minheight) {
        if (minheight < 0)
            minheight = 100;
        if (_minheight != minheight) {
            _minheight = minheight;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Window.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 789..796
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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 setMaxlength(int maxlength) {
        if (maxlength < 0)
            maxlength = 0;
        if (_maxlength != maxlength) {
            _maxlength = maxlength;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 6 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 368..375
zul/src/main/java/org/zkoss/zul/Panel.java on lines 317..324
zul/src/main/java/org/zkoss/zul/Panel.java on lines 341..348
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 322..329
zul/src/main/java/org/zkoss/zul/Window.java on lines 298..305
zul/src/main/java/org/zkoss/zul/Window.java on lines 322..329

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

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

                long min1 = (time1 < 0 ? (time1 - (1000 * 60 - 1)) : time1 ) / (1000 * 60);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/Dates.java and 1 other location - About 35 mins to fix
zcommon/src/main/java/org/zkoss/util/Dates.java on lines 449..449

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

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 (b) {
            final boolean igcs = s.readBoolean();
            _sortDsc = new RowComparator(this, false, igcs, false);
        } else {
            //bug #2830325 FieldComparator not castable to ListItemComparator
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Column.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 801..807

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

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 (found) {
                final int sz = eilst.size();
                _eis = sz == 0 ? null : eilst.toArray(new EventInterceptor[sz]);
                return true;
            }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.java on lines 77..81

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

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 (binding instanceof PropertyBinding) {
                    attr = ((PropertyBinding) binding).getFieldName();
                } else if (binding instanceof FormBinding) {
                    attr = ((FormBinding) binding).getFormId();
                } else {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 1 other location - About 35 mins to fix
zkbind/src/main/java/org/zkoss/bind/validator/AbstractValidator.java on lines 100..106

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

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 (key != null) {
                List<Message> keyMsgs = _keyMsgsMap.get(key);
                if (keyMsgs == null) {
                    _keyMsgsMap.put(key, keyMsgs = new ArrayList<Message>());
                }
zkbind/src/main/java/org/zkoss/bind/tracker/impl/BindUiLifeCycle.java on lines 296..303

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

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

            while (--cnt >= 0) {
                if (renderer == null)
                    renderer = (RowRenderer) getRealRenderer();
                rows.insertBefore(newUnloadedItem(renderer, min++), next);
            }
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java on lines 140..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 46.

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 setCharacterEncoding(String enc) throws java.io.UnsupportedEncodingException {
        //Ensure the specified encoding is valid
        byte[] buffer = new byte[1];
        buffer[0] = (byte) 'a';
        new String(buffer, enc); // dummy to check encoding
zweb/src/main/java/org/zkoss/web/portlet/RenderHttpServletRequest.java on lines 265..272

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

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

        }else if(data instanceof HostTreeModel.FakeHost){
            HostTreeModel.FakeHost host = ((HostTreeModel.FakeHost)data);
            Treecell cell = new Treecell(host.getName());
            //cell.setImage("/test2/img/add.gif");
            cell.setId(host.getId());
zktest/src/main/java/org/zkoss/zktest/test2/tree/HostTreeOpenCtrlRenderer2.java on lines 57..69

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

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