Showing 2,935 of 7,775 total issues

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

        if (this.needV) {
            y = _setScrollPos(y, 0, this.vLimit);
            var barPos = y / this.vRatio;
            this._syncPosition('ver', y);
            this._syncBarPosition('ver', barPos);
Severity: Major
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 334..340

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

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 (this.needH) {
            x = _setScrollPos(x, 0, this.hLimit);
            var barPos = x / this.hRatio;
            this._syncPosition('hor', x);
            this._syncBarPosition('hor', barPos);
Severity: Major
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 2 hrs to fix
zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 341..347

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

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

    private void renderWith(ActionContext ac, Status st, float[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Float(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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

    private void renderWith(ActionContext ac, Status st, int[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Integer(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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

    private void renderWith(ActionContext ac, Status st, byte[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Byte(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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

    private void renderWith(ActionContext ac, Status st, double[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Double(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342

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

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

    private void renderWith(ActionContext ac, Status st, char[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Character(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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

    private void renderWith(ActionContext ac, Status st, long[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Long(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 274..286
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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

    private void renderWith(ActionContext ac, Status st, short[] ary) throws DspException, IOException {
        final StringWriter out = getFragmentOut(ac, _trim);
        for (int j = _beg; j < ary.length && j <= _end; ++j) {
            final Object val = new Short(ary[j]);
            if (_var != null)
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 260..272
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 288..300
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 302..314
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 316..328
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 330..342
zweb/src/main/java/org/zkoss/web/servlet/dsp/action/ForEach.java on lines 344..356

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

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 void doDeserialize0(Div win, Label msg) throws Exception{
        ByteArrayInputStream oaos = new ByteArrayInputStream(_bytes);
        ObjectInputStream oos = new ObjectInputStream(oaos);

        Div newwin = (Div) oos.readObject();
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithList.java on lines 156..172
zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3816VM.java on lines 88..104

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

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 void doDeserialize0(Window win, Label msg) throws Exception{
        ByteArrayInputStream oaos = new ByteArrayInputStream(_bytes);
        ObjectInputStream oos = new ObjectInputStream(oaos);
        
        Window newwin = (Window) oos.readObject();
zktest/src/main/java/org/zkoss/zktest/test2/F80_ZK_2831.java on lines 110..126
zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3816VM.java on lines 88..104

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

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 void doDeserialize0(Window win, Label msg) throws Exception {
        ByteArrayInputStream oaos = new ByteArrayInputStream(_bytes);
        ObjectInputStream oos = new ObjectInputStream(oaos);

        Window newwin = (Window) oos.readObject();
zktest/src/main/java/org/zkoss/zktest/bind/viewmodel/form/FormWithList.java on lines 156..172
zktest/src/main/java/org/zkoss/zktest/test2/F80_ZK_2831.java on lines 110..126

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

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 (_rows != null && _model != null && inPagingMold()) {
                //theoretically, _rows shall not be null if _model is not null when
                //this method is called. But, just in case -- if sent manually
                final Paginal pgi = getPaginal();
                int pgsz = pgi.getPageSize();
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 1332..1349

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

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

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

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

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

Refactorings

Further Reading

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

            if (_model != null && inPagingMold()) {
                final Paginal pgi = getPaginal();
                int pgsz = pgi.getPageSize();
                int ofs = pgi.getActivePage() * pgsz;
                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/Grid.java on lines 639..658

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

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

/** ZKProxyTargetHandlers.java.

    Purpose:

    Description:
zkbind/src/main/java/org/zkoss/bind/init/ZKBinderPhaseListeners.java on lines 1..62

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

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

/** ZKBinderPhaseListeners.java.

    Purpose:

    Description:
zkbind/src/main/java/org/zkoss/bind/proxy/ZKProxyTargetHandlers.java on lines 1..62

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

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 static String[][] getMultiColumnArray(int count, int column) {
        String[][] data = new String[count][column];
        Random rand = new Random(new Random().nextLong());
        for (int i = 0; i < count; i++) {
            data[i] = new String[column];
zksandbox/src/main/java/org/zkoss/zksandbox/ModelProvider.java on lines 76..86

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

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 static String[][] getMultiColumnArray(int count, int column) {
        String[][] data = new String[count][column];
        Random rand = new Random(new Random().nextLong());
        for (int i = 0; i < count; i++) {
            data[i] = new String[column];
zktest/src/main/java/org/zkoss/zktest/util/ModelProvider.java on lines 76..86

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

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 String setWidgetOverride(String name, String script) {
        if (name == null)
            throw new IllegalArgumentException();

        final String old;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java and 1 other location - About 2 hrs to fix
zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java on lines 786..800

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

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

    final public static Date endOfDate(Date when, TimeZone tz) {
        if (tz == null)
            tz = TimeZones.getCurrent();

        final Calendar cal = Calendar.getInstance(tz);
Severity: Major
Found in zcommon/src/main/java/org/zkoss/util/Dates.java and 1 other location - About 2 hrs to fix
zcommon/src/main/java/org/zkoss/util/Dates.java on lines 141..154

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

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