Showing 2,934 of 7,758 total issues

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

    public void setSortDescending(String clsnm)
            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortDscNm.equals(clsnm)) {
            _sortDscNm = clsnm;
            smartUpdate("sortDescending", clsnm);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Column.java and 5 other locations - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 287..294

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

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

/* Progress.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Progress.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Base.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Canvas.java on lines 1..72
zhtml/src/main/java/org/zkoss/zhtml/Del.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Ins.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Menu.java on lines 1..61

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

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

/* Base.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Base.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Canvas.java on lines 1..72
zhtml/src/main/java/org/zkoss/zhtml/Del.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Ins.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Menu.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Progress.java on lines 1..71

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

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

    public void setSortDescending(String clsnm)
            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortDscNm.equals(clsnm)) {
            _sortDscNm = clsnm;
            smartUpdate("sortDescending", clsnm);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256

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

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

/* Menu.java

    Purpose:
        
    Description:
Severity: Major
Found in zhtml/src/main/java/org/zkoss/zhtml/Menu.java and 5 other locations - About 50 mins to fix
zhtml/src/main/java/org/zkoss/zhtml/Base.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Canvas.java on lines 1..72
zhtml/src/main/java/org/zkoss/zhtml/Del.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Ins.java on lines 1..61
zhtml/src/main/java/org/zkoss/zhtml/Progress.java on lines 1..71

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

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

    public void setSortAscending(String clsnm)
            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortAscNm.equals(clsnm)) {
            _sortAscNm = clsnm;
            smartUpdate("sortAscending", clsnm);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Treecol.java and 5 other locations - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 287..294

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

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

    public void setSortAscending(String clsnm)
            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortAscNm.equals(clsnm)) {
            _sortAscNm = clsnm;
            smartUpdate("sortAscending", clsnm);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Column.java and 5 other locations - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 333..340
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 287..294

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

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

    public void setSortDescending(String clsnm)
            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        if (!Strings.isBlank(clsnm) && clsnm.startsWith("client") && !_sortDscNm.equals(clsnm)) {
            _sortDscNm = clsnm;
            smartUpdate("sortDescending", clsnm);
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listheader.java and 5 other locations - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Column.java on lines 269..276
zul/src/main/java/org/zkoss/zul/Column.java on lines 312..319
zul/src/main/java/org/zkoss/zul/Listheader.java on lines 290..297
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 249..256
zul/src/main/java/org/zkoss/zul/Treecol.java on lines 287..294

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

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 (_model == null || items.size() < 1)
                                return null;
                            else {
                                Set<Object> s = new LinkedHashSet<Object>();
                                s.add(_model.getElementAt(((Comboitem) items.iterator().next()).getIndex()));
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Tab.java on lines 435..441

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

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 (model == null || items.size() < 1)
                                return null;
                            else {
                                Set<Object> s = new LinkedHashSet<Object>();
                                s.add(model.getElementAt(((Tab) items.iterator().next()).getIndex()));
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tab.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Combobox.java on lines 1071..1077

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

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 (int j = 0; j < HEXA_CHARS_UPPER.length; j++) {
                if (c == HEXA_CHARS_UPPER[j] || c == HEXA_CHARS_LOWER[j]) {
                    n = j;
                    break;
                }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java and 1 other location - About 50 mins to fix
zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java on lines 545..550

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

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 (int j = 0; j < HEXA_CHARS_UPPER.length; j++) {
                if (c == HEXA_CHARS_UPPER[j] || c == HEXA_CHARS_LOWER[j]) {
                    n = j;
                    break;
                }
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java and 1 other location - About 50 mins to fix
zcommon/src/main/java/org/zkoss/lang/JavaScriptEscapeUtil.java on lines 529..534

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

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

    public static final String outDeviceStyleSheets(String deviceType) {
        final Execution exec = Executions.getCurrent();
        if (exec != null)
            return HtmlPageRenders.outLangStyleSheets(exec, null, null);

Severity: Major
Found in zk/src/main/java/org/zkoss/zk/fn/DspFns.java and 2 other locations - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/fn/DspFns.java on lines 46..54
zk/src/main/java/org/zkoss/zk/fn/DspFns.java on lines 89..97

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

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 (newChild instanceof Paging) {
            refChild = null; // the last: paging
            if (super.insertBefore(newChild, refChild)) {
                _pgi = _paging = (Paging) newChild;
                return true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Tree.java on lines 1315..1323

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

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 (sid != null) { //Some client might not have ZK-SID
            //B65-ZK-2464 : Possible XSS Vulnerability in HTTP Header
            try {
                Integer.parseInt(sid);
            } catch (NumberFormatException e) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java on lines 557..567

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

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 (sid != null) {
            //B65-ZK-2464 : Possible XSS Vulnerability in HTTP Header
            try {
                Integer.parseInt(sid);
            } catch (NumberFormatException e) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java on lines 478..488

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

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 (newChild instanceof Paging) {
            refChild = null; //the last: paging
            if (super.insertBefore(newChild, refChild)) {
                _pgi = _paging = (Paging) newChild;
                return true;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 1 other location - About 50 mins to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1789..1798

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

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 boolean addFunctionMapper(FunctionMapper mapper) {
        if (mapper == null)
            return false;

        if (_mappers == null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java and 1 other location - About 50 mins to fix
zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 667..678

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

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 (name != null) {
                name = BindEvaluatorXUtil.eval(evalx, comp, expr = name, String.class);
                if (Strings.isBlank(name)) {
                    throw new UiException(MiscUtil
                            .formatLocationMessage("evaluated queue name is empty, expression is " + expr, initanno));
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java and 1 other location - About 50 mins to fix
zkbind/src/main/java/org/zkoss/bind/BindComposer.java on lines 399..405

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

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 (classes != null && !classes.isEmpty()) {
            for (String className : classes) {
                try {
                    addIgnoredProxyClass(Classes.forNameByThread(className.trim()));
                } catch (ClassNotFoundException ex) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/proxy/ProxyHelper.java and 1 other location - About 50 mins to fix
zkbind/src/main/java/org/zkoss/bind/proxy/ProxyHelper.java on lines 68..76

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

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