Showing 2,934 of 7,758 total issues

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

        setUTCSeconds(uTCSeconds: number): number {
            return this._getUTCMoment().second(uTCSeconds).valueOf();
        }
Severity: Major
Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    'Color' :
    { 
        Element        : 'span', 
        Styles        : { 'color' : '#("Color","color")' }, 
        Overrides    : [ { Element : 'font', Attributes : { 'color' : null } } ]
Severity: Minor
Found in zksandbox/src/main/webapp/macros/fckconfig.js and 1 other location - About 35 mins to fix
zksandbox/src/main/webapp/macros/fckconfig.js on lines 228..233

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    innerY(): number {
        return Math.round(window.pageYOffset
            || DocRoot().scrollTop || 0); //ZK-2633: browser might return decimal number
    },
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts and 1 other location - About 35 mins to fix
zk/src/main/resources/web/js/zk/dom.ts on lines 2127..2130

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

        setSeconds(seconds: number): number {
            return this._getTzMoment().second(seconds).valueOf();
        }
Severity: Major
Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 181..183
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

        setUTCHours(uTCHours: number): number {
            return this._getUTCMoment().hour(uTCHours).valueOf();
        }
Severity: Major
Found in zk/src/main/resources/web/js/zk/dateImpl.ts and 11 other locations - About 35 mins to fix
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 125..127
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 152..154
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 156..158
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 160..162
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 164..166
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 173..175
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 177..179
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 185..187
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 189..191
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 193..195
zk/src/main/resources/web/js/zk/dateImpl.ts on lines 197..199

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    innerX(): number {
        return Math.round(window.pageXOffset
            || DocRoot().scrollLeft || 0); //ZK-2633: browser might return decimal number
    },
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts and 1 other location - About 35 mins to fix
zk/src/main/resources/web/js/zk/dom.ts on lines 2134..2137

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        treeModel = new DefaultTreeModel<String>(newNode("root", level1Nodes()));
        tree.setItemRenderer(getTreeItemRenderer());
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java and 3 other locations - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 44..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 46..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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

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

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

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

Refactorings

Further Reading

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

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        treeModel = new DefaultTreeModel<String>(newNode("root", level1Nodes()));

Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java and 3 other locations - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 44..51

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

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

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

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

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

Refactorings

Further Reading

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

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        treeModel = new DefaultTreeModel<String>(newNode("root", level1Nodes()));
        tree.setItemRenderer(getTreeItemRenderer());
Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java and 3 other locations - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java on lines 44..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 46..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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

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

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

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

Refactorings

Further Reading

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

    @Override
    public void doAfterCompose(Component comp) throws Exception {
        super.doAfterCompose(comp);
        treeModel = new DefaultTreeModel<String>(newNode("root", level1Nodes()));

Severity: Major
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_2.java and 3 other locations - About 30 mins to fix
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_1.java on lines 45..51
zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java on lines 46..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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 (ProxyFactory.isProxyClass(type)) {
            type = type.getSuperclass();
            if (obj != null && type.isAssignableFrom(obj.getClass()))
                return obj;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 2 other locations - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 590..594
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 688..692

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

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 (ProxyFactory.isProxyClass(type)) {
            type = type.getSuperclass();
            if (obj != null && type.isAssignableFrom(obj.getClass()))
                return obj;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 2 other locations - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 524..528
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 688..692

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

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

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

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

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

Refactorings

Further Reading

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

    public void setValue(double val) {
        if (Double.compare(_value, val) != 0) {
            _value = val;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_VALUE, val);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

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

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

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

Refactorings

Further Reading

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

    public void setTextRadius(double radius) {
        if (Double.compare(_textRadius, radius) != 0) {
            _textRadius = radius;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TEXT_RADIUS, radius);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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 (ProxyFactory.isProxyClass(type)) {
            type = type.getSuperclass();
            if (obj != null && type.isAssignableFrom(obj.getClass()))
                return obj;
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java and 2 other locations - About 30 mins to fix
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 524..528
zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java on lines 590..594

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

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

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

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

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

Refactorings

Further Reading

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

    public void setValueAngle(double angle) {
        if (Double.compare(_valueAngle, angle) != 0) {
            _valueAngle = angle;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_ANGLE, angle);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

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

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

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

Refactorings

Further Reading

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

    public void setValueRadius(double radius) {
        if (Double.compare(_valueRadius, radius) != 0) {
            _valueRadius = radius;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_RADIUS, radius);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

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

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

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

Refactorings

Further Reading

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

    public void setTickLabelOffset(double tickLabelOffset) {
        if (Double.compare(_tickLabelOffset, tickLabelOffset) != 0) {
            _tickLabelOffset = tickLabelOffset;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_LABEL_OFFSET, tickLabelOffset);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

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

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

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

Refactorings

Further Reading

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

    public void setTickRadius(double radius) {
        if (Double.compare(_tickRadius, radius) != 0) {
            _tickRadius = radius;
            fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_RADIUS, radius);
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

    void addChild(Node node) {
        if (node == null)
            throw new IllegalArgumentException("null");
        if (_children == null)
            _children = new LinkedList<Node>();
Severity: Major
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Node.java and 4 other locations - About 30 mins to fix
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 378..385
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 410..417
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 422..429
zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinition.java on lines 546..553

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

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