Showing 2,934 of 7,758 total issues

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

  private boolean jj_3R_70() {
    if (jj_3R_71()) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 12 other locations - About 40 mins to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2103..2111
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2129..2137
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2168..2176
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2194..2202
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2204..2212
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2214..2222
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2390..2398
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2425..2433
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2587..2595
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2642..2650
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2706..2714
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 2790..2798

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

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

    public void clear() {
        int i2 = _list.size() - 1;
        if (i2 < 0) {
            return;
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/ListModelList.java and 4 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 218..226
zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 536..544
zul/src/main/java/org/zkoss/zul/ListModelMap.java on lines 742..750
zul/src/main/java/org/zkoss/zul/ListModelSet.java on lines 216..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 51.

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 updateByClient(String name, Object value) {
        if ("disabled".equals(name))
            setDisabled(value instanceof Boolean ? ((Boolean) value).booleanValue()
                    : "true".equals(Objects.toString(value)));
        else
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Checkbox.java and 2 other locations - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Button.java on lines 302..308
zul/src/main/java/org/zkoss/zul/Menuitem.java on lines 340..346

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

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 String toString() {
        return new StringBuilder().append(getClass().getSimpleName()).append("@")
                .append(Integer.toHexString(hashCode())).append(",base:").append(getBase()).append(",property:")
                .append(getProperty()).append(",value:").append(getValue()).toString();
    }
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/PropertyImpl.java and 1 other location - About 40 mins to fix
zkbind/src/main/java/org/zkoss/bind/impl/WrongValuePropertyImpl.java on lines 63..67

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

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

    public static class Couple {
        private Person person1;
        private Person person2;
        public Couple(Person person1, Person person2) {
            this.person1 = person1;
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java and 3 other locations - About 40 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_2859.java on lines 23..42
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 47..60
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_4988VM.java on lines 39..55

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

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

    protected Object getTargetValue() throws WrongValueException {
        Object val = super.getTargetValue();

        // ZK-1949, we need to accept the null value when invoking getValue()
        if (val == null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Doublespinner.java and 1 other location - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Spinner.java on lines 67..77

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

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

    protected Object getTargetValue() throws WrongValueException {
        Object val = super.getTargetValue();

        // ZK-1949, we need to accept the null value when invoking getValue()
        if (val == null)
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Spinner.java and 1 other location - About 40 mins to fix
zul/src/main/java/org/zkoss/zul/Doublespinner.java on lines 62..73

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

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

    public class Coord {
        private double x;
        private double y;

        public Coord(double x, double y) {
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_2859.java on lines 23..42
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 47..60
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 62..75

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

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

    public static class Person {
        private String name;
        private PersonalDetails personalDetails;
        protected Person(String name, PersonalDetails personalDetails) {
            this.name = name;
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java and 3 other locations - About 40 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_2859.java on lines 23..42
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 62..75
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_4988VM.java on lines 39..55

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

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

public class B80_ZK_2859 implements Serializable {

    private String id;

    private String label;
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_2859.java and 3 other locations - About 40 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 47..60
zktest/src/main/java/org/zkoss/zktest/test2/B80_ZK_3611VM.java on lines 62..75
zktest/src/main/java/org/zkoss/zktest/test2/F100_ZK_4988VM.java on lines 39..55

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

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

    private static <E> Collection<E> combine(Collection<E> first, Collection<E> second) {
        return DualCollection.combine(first != null && !first.isEmpty() ? first : null,
                second != null && !second.isEmpty() ? second : null);
    }
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java and 2 other locations - About 40 mins to fix
zcommon/src/main/java/org/zkoss/xel/util/DualFunctionMapper.java on lines 84..88
zcommon/src/main/java/org/zkoss/xel/util/SimpleMapper.java on lines 71..75

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

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 T getChild(Object parent, int index) {
        int i = _tree.indexOf(parent) * 2 + 1 + index;
        if (i >= _tree.size())
            return null;
        else
zksandbox/src/main/java/org/zkoss/zksandbox/tree/BinaryTreeModel.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/tree/BinaryTreeModel.java on lines 46..52

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

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

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/MethodNotFoundException.java and 2 other locations - About 40 mins to fix
zel/src/main/java/org/zkoss/zel/ELException.java on lines 1..68
zel/src/main/java/org/zkoss/zel/PropertyNotFoundException.java on lines 1..38

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

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 String toString() {
        return new StringBuilder().append(getClass().getSimpleName()).append("@")
                .append(Integer.toHexString(hashCode())).append(",base:").append(getBase()).append(",property:")
                .append(getProperty()).append(",value:").append(getValue()).toString();
    }
zkbind/src/main/java/org/zkoss/bind/impl/PropertyImpl.java on lines 48..52

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

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

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/ELException.java and 2 other locations - About 40 mins to fix
zel/src/main/java/org/zkoss/zel/MethodNotFoundException.java on lines 1..38
zel/src/main/java/org/zkoss/zel/PropertyNotFoundException.java on lines 1..38

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

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 Object getChild(Object parent, int index) {
        int i = _tree.indexOf(parent) *2 +1 + index;
        if( i>= _tree.size())
            return null;
        else
zksandbox/src/main/java/org/zkoss/zksandbox/tree/BinaryTreeModel.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2375_TreeVM.java on lines 52..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 51.

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

    private static Collection<String> combine(Collection<String> first, Collection<String> second) {
        return DualCollection.combine(
            first != null && !first.isEmpty() ? first: null,
            second != null && !second.isEmpty() ? second: null);
    }
Severity: Major
Found in zcommon/src/main/java/org/zkoss/xel/util/SimpleMapper.java and 2 other locations - About 40 mins to fix
zcommon/src/main/java/org/zkoss/xel/util/DualFunctionMapper.java on lines 84..88
zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java on lines 1361..1364

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

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 SystemException wrap(Throwable t, String msg) {
            t = Exceptions.unwrap(t);
            if (t instanceof Expectable)
                return (OperationException)
                    Exceptions.wrap(t, OperationException.class, msg);
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/lang/SystemException.java and 1 other location - About 40 mins to fix
zcommon/src/main/java/org/zkoss/lang/SystemException.java on lines 85..92

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

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 PageDefinition parse(URL url, String path) throws Exception {
        //if (log.isDebugEnabled()) log.debug("Parsing "+url);
        String extension = Servlets.getExtension(url.toExternalForm());
        final PageDefinition pgdef = parse(TreeBuilderFactory.makeBuilder(extension).parse(url), extension);
        pgdef.setRequestPath(path);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java and 1 other location - About 40 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java on lines 117..123

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

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

        getState(SubState.MAIN).addRoute(Token.Type.NTN_PSDOELEM, SubState.PSDOELEM_PRE_NAME).addRoute(Token.Type.IDENTIFIER,
                SubState.MAIN, new StateCtx.TransitionListener<Token, Token.Type>() {
                    public void onTransit(Token input, Token.Type inputClass) {
                        // flush pseudo class function name
                        _seq.addPseudoElement(input.source(_source));
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/InSeqMachine.java and 1 other location - About 40 mins to fix
zk/src/main/java/org/zkoss/zk/ui/select/impl/InSeqMachine.java on lines 81..87

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

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