Showing 2,935 of 7,775 total issues

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

        public static SystemException wrap(Throwable t, int code, Object fmtArg) {
            t = Exceptions.unwrap(t);
            if (t instanceof Expectable)
                return (OperationException)
                    Exceptions.wrap(t, OperationException.class, code, fmtArg);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/SystemException.java and 1 other location - About 45 mins to fix
zcommon/src/main/java/org/zkoss/lang/SystemException.java on lines 61..68

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

    private static void removeFromIdSpaces(final Component comp) {
        final String compId = comp.getId();
        if (comp instanceof NonFellow || isAutoId(compId))
            return; //nothing to do

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 228..237

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

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

        if (_webctx.shallCompress(request, "wcs") && data.length > 200) {
            byte[] bs = Https.gzip(request, response, null, data);
            if (bs != null)
                data = bs; //yes, browser support compress
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WcsExtendlet.java and 1 other location - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java on lines 114..118

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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 final String getThisQueryString(ServletRequest request) {
        String path = (String) request.getAttribute(Attributes.INCLUDE_QUERY_STRING);
        return path != null || isIncluded(request) || !(request instanceof HttpServletRequest) ? path
                : //null is valid even included
                ((HttpServletRequest) request).getQueryString();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java and 1 other location - About 45 mins to fix
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 212..217

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

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

    /*package*/ void setLoaded(boolean loaded) {
        if (loaded != _loaded) {
            _loaded = loaded;

            final Grid grid = getGrid();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Row.java and 1 other location - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/Listitem.java on lines 241..249

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

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

        if (_webctx.shallCompress(request, "wpd") && data.length > 200) {
            byte[] bs = Https.gzip(request, response, null, data);
            if (bs != null)
                data = bs; //yes, browser support compress
        }
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java and 1 other location - About 45 mins to fix
zk/src/main/java/org/zkoss/zk/ui/http/WcsExtendlet.java on lines 157..161

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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 final String getThisPathInfo(ServletRequest request) {
        String path = (String) request.getAttribute(Attributes.INCLUDE_PATH_INFO);
        return path != null || isIncluded(request) || !(request instanceof HttpServletRequest) ? path
                : //null is valid even included
                ((HttpServletRequest) request).getPathInfo();
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java and 1 other location - About 45 mins to fix
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 199..204

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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 final String getOriginQueryString(ServletRequest request) {
        String path = (String) request.getAttribute(Attributes.FORWARD_QUERY_STRING);
        return path != null ? path : isForwarded(request) ? null
                : //null is valid even included
                request instanceof HttpServletRequest ? ((HttpServletRequest) request).getQueryString() : null;
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.java and 1 other location - About 45 mins to fix
zweb/src/main/java/org/zkoss/web/servlet/http/Https.java on lines 254..259

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

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

    @Listen("onClick = #rebuildButton")
    public void rebuildModel() {
        //backup open paths
        int[][] openPaths = treeModel.getOpenPaths();
        treeModel.clearOpen();
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java and 3 other locations - About 45 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

        protected void removeRange(int fromIndex, int toIndex) {
            ListIterator<Component> it = listIterator(toIndex);
            for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                it.previous();
                it.remove();
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Rows.java and 2 other locations - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 417..423
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 483..489

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

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

        protected void removeRange(int fromIndex, int toIndex) {
            ListIterator<Component> it = listIterator(toIndex);
            for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                it.previous();
                it.remove();
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 417..423
zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

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

    @Listen("onClick = #rebuildButton")
    public void rebuildModel() {
        //backup open paths
        int[][] openPaths = treeModel.getOpenPaths();
        treeModel.clearOpen();
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java and 3 other locations - About 45 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

            protected void removeRange(int fromIndex, int toIndex) {
                ListIterator<Listitem> it = listIterator(toIndex);
                for (int n = toIndex - fromIndex; --n >= 0 && it.hasPrevious();) {
                    it.previous();
                    it.remove();
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 483..489
zul/src/main/java/org/zkoss/zul/Rows.java on lines 678..684

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

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

    @Listen("onClick = #rebuildButton")
    public void rebuildModel() {
        //backup open paths
        int[][] openPaths = treeModel.getOpenPaths();
        treeModel.clearOpen();
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java and 3 other locations - About 45 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 109..121

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

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

    @Listen("onClick = #rebuildButton")
    public void rebuildModel() {
        //backup open paths
        int[][] openPaths = treeModel.getOpenPaths();
        treeModel.clearOpen();
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java and 3 other locations - About 45 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 68..78
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 83..95

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

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

    @Command
    public void remove() {
        model_l.remove(model_l.getSize() - 1);
        model_m.remove(model_m.getElementAt(model_m.getSize() - 1).getKey());
        model_s.remove(model_s.getElementAt(model_s.getSize() - 1));
zktest/src/main/java/org/zkoss/zktest/zats/zuti/vm/ForEachListModelVM.java on lines 219..224

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

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

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

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

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

Refactorings

Further Reading

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

    private static class AuxInfo implements java.io.Serializable, Cloneable {
        /** The error message. Not null if users entered a wrong data (and
         * not correct it yet).
         */
        private String errmsg;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.java and 1 other location - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/impl/LabelImageElement.java on lines 519..544

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

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

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

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

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

Refactorings

Further Reading

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

    private void collectSavePropertyAfter(Component comp, String command, Event evt, Set<Property> validates) {
        final List<SavePropertyBinding> bindings = _infoProvider.getSaveAfterBindings().get(command); //_saveAfterBindings.get(command);
        if (bindings != null) {
            for (SavePropertyBinding binding : bindings) {
                collectSavePropertyBinding(comp, binding, command, evt, validates);
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java and 3 other locations - About 45 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 76..83
zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 86..93
zkbind/src/main/java/org/zkoss/bind/impl/ValidationHelper.java on lines 112..119

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

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

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

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

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

Refactorings

Further Reading

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

    private <T> Set<T> collectUnselectedObjects(Set<T> previousSelection, Set<T> currentSelection) {
        Set<T> prevSeldItems = previousSelection != null ? new LinkedHashSet<T>(previousSelection)
                : new LinkedHashSet<T>();
        if (currentSelection != null && prevSeldItems.size() > 0)
            prevSeldItems.removeAll(currentSelection);
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 45 mins to fix
zul/src/main/java/org/zkoss/zul/Tree.java on lines 2763..2769

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

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 List<Food> getSortedName(){
        if(selected==null) return null;
        List sorted = new ArrayList();
        for(Food f:selected){
            sorted.add(f.getName());
zktest/src/main/java/org/zkoss/zktest/bind/issue/B00967GroupModelListboxMultiple.java on lines 44..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 55.

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