Showing 2,936 of 7,765 total issues

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

                if (inPagingMold()) {
                    if (_model instanceof PageableModel)
                        ((PageableModel) _model).addPagingEventListener((PagingListener) _pgListener);
                    //B30-2129667, B36-2782751, (ROD) exception when zul applyProperties
                    //must update paginal totalSize or exception in setActivePage
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 1 other location - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2361..2385

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

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

    case EMPTY:
      jj_consume_token(EMPTY);
                  AstEmpty jjtn003 = new AstEmpty(JJTEMPTY);
                  boolean jjtc003 = true;
                  jjtree.openNodeScope(jjtn003);
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 1 other location - About 2 hrs to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1196..1222

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

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 (type == ListDataEvent.STRUCTURE_CHANGED && _model instanceof Sortable && _cols != null) { //ZK-1704 added null check for _cols
                Sortable<Object> smodel = cast(_model);
                List<Column> cols = cast(_cols.getChildren());
                boolean found = false;
                for (Column col : cols) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 2 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2656..2675
zul/src/main/java/org/zkoss/zul/Tree.java on lines 1598..1617

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

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 String[] _dict = { //alphabetic order
        "abacus", "accuracy", "acuity", "adage", "afar", "after", "apple",
        "bible", "bird", "bingle", "blog",
        "cabane", "cape", "cease", "cedar",
        "dacron", "defacto", "definable", "deluxe",
zksandbox/src/main/java/org/zkoss/zksandbox/SimpleAutoComplete.java on lines 32..58

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

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 (_model instanceof Sortable) {
                final Sortable<Object> smodel = cast(_model);
                final List<Treecol> cols = cast(_treecols.getChildren());
                boolean found = false;
                for (final Treecol col : cols) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 2 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1134..1153
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 2656..2675

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

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 (event.getType() == ListDataEvent.STRUCTURE_CHANGED && _model instanceof Sortable && _listhead != null) { //ZK-1705 added null check for _listhead
                Sortable<Object> smodel = cast(_model);
                List<Listheader> headers = cast(_listhead.getChildren());
                boolean found = false;
                for (Listheader col : headers) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 2 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1134..1153
zul/src/main/java/org/zkoss/zul/Tree.java on lines 1598..1617

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

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

    case MINUS:
      jj_consume_token(MINUS);
                  AstNegative jjtn001 = new AstNegative(JJTNEGATIVE);
                  boolean jjtc001 = true;
                  jjtree.openNodeScope(jjtn001);
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 1 other location - About 2 hrs to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1262..1288

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

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

      case MINUS:
        jj_consume_token(MINUS);
                   AstMinus jjtn002 = new AstMinus(JJTMINUS);
                   boolean jjtc002 = true;
                   jjtree.openNodeScope(jjtn002);
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 2 other locations - About 2 hrs to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 994..1020
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1077..1103

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

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 (inPagingMold()) {
                    if (_model instanceof PageableModel)
                        ((PageableModel) _model).addPagingEventListener((PagingListener) _pgListener);
                    //B30-2129667, B36-2782751, (ROD) exception when zul applyProperties
                    //must update paginal totalSize or exception in setActivePage
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 811..835

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

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

      case PLUS:
        jj_consume_token(PLUS);
                  AstPlus jjtn001 = new AstPlus(JJTPLUS);
                  boolean jjtc001 = true;
                  jjtree.openNodeScope(jjtn001);
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 2 other locations - About 2 hrs to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1021..1047
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1077..1103

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

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

                for (int j = 0, len = value.length(); j < len; ++j) {
                    final char cc = value.charAt(j);
                    final String rep;
                    switch (cc) {
                    case '<':
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java and 1 other location - About 2 hrs to fix
zcommon/src/main/java/org/zkoss/xml/XMLs.java on lines 55..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 150.

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

        for (int j = 0, len = value.length(); j < len; ++j) {
            final char cc = value.charAt(j);
            final String rep;
            switch (cc) {
            case '"': rep = "&quot;"; break;
Severity: Major
Found in zcommon/src/main/java/org/zkoss/xml/XMLs.java and 1 other location - About 2 hrs to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/NativeInfo.java on lines 122..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 150.

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 (beforeCmds != null && beforeCmds.length > 0) {
                for (String cmd : beforeCmds) {
                    LoadPropertyBinding binding = newLoadPropertyBinding(comp, attr, loadRep, attrType, loadExpr,
                            ConditionType.BEFORE_COMMAND, cmd, bindingArgs, converterExpr, converterArgs);
                    addBinding(comp, attr, binding);
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 1 other location - About 2 hrs to fix
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 1277..1293

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

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 (afterCmds != null && afterCmds.length > 0) {
                for (String cmd : afterCmds) {
                    LoadPropertyBinding binding = newLoadPropertyBinding(comp, attr, loadRep, attrType, loadExpr,
                            ConditionType.AFTER_COMMAND, cmd, bindingArgs, converterExpr, converterArgs);
                    addBinding(comp, attr, binding);
Severity: Major
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java and 1 other location - About 2 hrs to fix
zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java on lines 1260..1276

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

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

    protected Object coerceFromString(String value) throws WrongValueException {
        final Object[] vals = toNumberOnly(value);
        final String val = (String) vals[0];
        if (val == null || val.length() == 0)
            return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Doublespinner.java and 3 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Intbox.java on lines 72..87
zul/src/main/java/org/zkoss/zul/Longbox.java on lines 91..106
zul/src/main/java/org/zkoss/zul/Spinner.java on lines 134..149

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

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

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

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

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

Refactorings

Further Reading

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

        public void onEvent(Event event) {
            //Bug ZK-1622: reset anchor position after changing page
            _anchorTop = 0;
            _anchorLeft = 0;
            if (event instanceof PagingEvent) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Tree.java and 1 other location - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 1302..1322

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

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

    protected Object coerceFromString(String value) throws WrongValueException {
        final Object[] vals = toNumberOnly(value);
        final String val = (String) vals[0];
        if (val == null || val.length() == 0)
            return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Intbox.java and 3 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Doublespinner.java on lines 138..153
zul/src/main/java/org/zkoss/zul/Longbox.java on lines 91..106
zul/src/main/java/org/zkoss/zul/Spinner.java on lines 134..149

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

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

    protected Object coerceFromString(String value) throws WrongValueException {
        final Object[] vals = toNumberOnly(value);
        final String val = (String) vals[0];
        if (val == null || val.length() == 0)
            return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Longbox.java and 3 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Doublespinner.java on lines 138..153
zul/src/main/java/org/zkoss/zul/Intbox.java on lines 72..87
zul/src/main/java/org/zkoss/zul/Spinner.java on lines 134..149

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

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

    protected Object coerceFromString(String value) throws WrongValueException {
        final Object[] vals = toNumberOnly(value);
        final String val = (String) vals[0];
        if (val == null || val.length() == 0)
            return null;
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Spinner.java and 3 other locations - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Doublespinner.java on lines 138..153
zul/src/main/java/org/zkoss/zul/Intbox.java on lines 72..87
zul/src/main/java/org/zkoss/zul/Longbox.java on lines 91..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 148.

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

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

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

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

Refactorings

Further Reading

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

        public void onEvent(Event event) {
            //Bug ZK-1622: reset anchor position after changing page
            _anchorTop = 0;
            _anchorLeft = 0;
            if (event instanceof PagingEvent) {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 2 hrs to fix
zul/src/main/java/org/zkoss/zul/Tree.java on lines 539..559

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

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