Showing 2,935 of 7,775 total issues

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

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

        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

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

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

        }else if(data instanceof HostTreeModel.FakeProcess){
            HostTreeModel.FakeProcess process = ((HostTreeModel.FakeProcess)data);
            Treecell cell = new Treecell(process.getName());
            /*if(process.getType().equals("A")){
                cell.setImage("/test2/img/caldrbtn.gif");
zktest/src/main/java/org/zkoss/zktest/test2/tree/HostIconTreeRenderer.java on lines 47..53

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

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

                if (next != null && !(next instanceof HtmlShadowElement)) {
                    Component newNext = child._nextInsertion;
                    setPrevInsertion(newNext, next);
                    setPrevInsertion(next, child);
                }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java on lines 683..687

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

                for (Iterator itt = it.next().entrySet().iterator(); itt.hasNext();) {
                    final Map.Entry me = (Map.Entry) itt.next();
                    renderValue(me.getKey()); //allow ':' or others
                    sb.append(':');
                    renderValue(me.getValue());
zk/src/main/java/org/zkoss/zk/ui/sys/JsContentRenderer.java on lines 478..484

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

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

            SelectEvent evt = new SelectEvent(Events.ON_SELECT, this, curSeldItems, prevSeldItems, unselectedItems,
                    selectedObjects, prevSeldObjects, unselectedObjects,
                    desktop.getComponentByUuidIfAny((String) data.get("reference")), null, AuRequests.parseKeys(data));
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 3813..3815

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

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

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 (pgdef._hdBfrDefs != null && directives != null && contains(directives, "meta")) {
            for (HeaderInfo hi : pgdef._hdBfrDefs)
                addHeaderInfo(hi, true);
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 321..324

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 (pgdef._hdAftDefs != null && directives != null && contains(directives, "meta")) {
            for (HeaderInfo hi : pgdef._hdAftDefs)
                addHeaderInfo(hi, false);
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java and 1 other location - About 35 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 317..320

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 (batchRemove != null) {
                //ZK-2224 batch remove component and it kids to enhance performance.
                Set<Component> components = batchRemove.get(binder);
                if (components == null) {
                    batchRemove.put(binder, components = new LinkedHashSet<Component>());
zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java on lines 238..244

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