Showing 2,934 of 7,758 total issues

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

    private boolean isCheckmarkDeselectOther() {
        if (_ckDeselectOther == null) //ok to race
            _ckDeselectOther = Boolean
                    .valueOf("true".equals(Library.getProperty("org.zkoss.zul.tree.checkmarkDeselectOthers")));
        return Utils.testAttribute(this, "org.zkoss.zul.tree.checkmarkDeselectOthers", _ckDeselectOther.booleanValue(), true);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3486..3491

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

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

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

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

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

Refactorings

Further Reading

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

    public static void setPriority(String themeName, int priority) {
        ThemeRegistry themeRegistry = ThemeFns.getThemeRegistry();
        Theme theme = themeRegistry.getTheme(themeName);

        if (theme instanceof StandardTheme) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/theme/Themes.java and 1 other location - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/theme/Themes.java on lines 181..187

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

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/ListModelArrayProxy.java on lines 368..373
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 4 locations. Consider refactoring.
Open

        for (PagingListener p : _pagingListeners) {
            try {
                p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, pg));
            } catch (Exception e) {
                log.warn("Failed to publish internal paging event", e);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/AbstractListModel.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 365..371
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 820..826
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 913..919

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 " + flnm, 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 146..151

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/Va03.java on lines 50..63
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 4 locations. Consider refactoring.
Open

        for (PagingListener p : _pagingListeners) {
            try {
                p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, _activePage));
            } catch (Exception e) {
                log.warn("Failed to publish internal paging event", e);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/AbstractListModel.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 403..409
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 820..826
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 913..919

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/Va04.java on lines 60..73
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/validator/Va10.java on lines 156..169

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 " + url, ioex);
zweb/src/main/java/org/zkoss/web/util/resource/ResourceCaches.java on lines 126..131
zweb/src/main/java/org/zkoss/web/util/resource/ResourceCaches.java on lines 146..151

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/ListModelArrayProxy.java on lines 368..373
zkbind/src/main/java/org/zkoss/bind/proxy/ListModelListProxy.java on lines 511..516

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

        for (PagingListener p : _pagingListeners) {
            try {
                p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, pg));
            } catch (Exception e) {
                log.warn("Failed to publish internal paging event", e);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 365..371
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 403..409
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 820..826

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 {
                _idgen = (IdGenerator) 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 171..177
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 4 locations. Consider refactoring.
Open

        for (PagingListener p : _pagingListeners) {
            try {
                p.onEvent(new PagingEvent(PageableModel.INTERNAL_EVENT, null, this, _activePage));
            } catch (Exception e) {
                log.warn("Failed to publish internal paging event", e);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java and 3 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 365..371
zul/src/main/java/org/zkoss/zul/AbstractListModel.java on lines 403..409
zul/src/main/java/org/zkoss/zul/AbstractTreeModel.java on lines 913..919

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 {
                _audec = (AuDecoder) 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 171..177
zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java on lines 179..185

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/ListModelArrayProxy.java on lines 368..373
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 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/Va04.java on lines 60..73
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 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 zkbind/src/main/java/org/zkoss/bind/impl/BindRowRenderer.java and 2 other locations - About 35 mins to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1159..1163
zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java on lines 256..260

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/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/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 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/Grid.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/impl/GridDataLoader.java on lines 256..260

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/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 298..305

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