wikimedia/mediawiki-core

View on GitHub

Showing 2,063 of 11,773 total issues

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

OO.ui.FieldLayout.prototype.onLabelClick = function () {
    this.fieldWidget.simulateLabelClick();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 5 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 9571..9573
resources/lib/ooui/oojs-ui-widgets.js on lines 3983..3985
resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.js on lines 232..234
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 243..245
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 250..252

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

            case 'hour|012':
                spec = {
                    component: 'hour12',
                    calendarComponent: false,
                    type: 'number',
resources/src/mediawiki.widgets.datetime/DiscordianDateTimeFormatter.js on lines 175..183
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 312..320
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 392..400

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

        meridiem: function (hours, minutes, isLower) {
            if (hours < 12) {
                return isLower ? 'sa' : 'SA';
            } else {
                return isLower ? 'ch' : 'CH';
Severity: Major
Found in resources/lib/moment/locale/vi.js and 5 other locations - About 35 mins to fix
resources/lib/moment/locale/af.js on lines 28..34
resources/lib/moment/locale/el.js on lines 47..53
resources/lib/moment/locale/eo.js on lines 38..44
resources/lib/moment/locale/si.js on lines 68..74
resources/lib/moment/locale/tzl.js on lines 37..43

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

    if ( e.keyCode === OO.ui.Keys.LEFT || e.keyCode === OO.ui.Keys.UP ) {
        nextItem = element.getRelativeFocusableItem( this, -1 );
    } else if ( e.keyCode === OO.ui.Keys.RIGHT || e.keyCode === OO.ui.Keys.DOWN ) {
        nextItem = element.getRelativeFocusableItem( this, 1 );
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 5 other locations - About 35 mins to fix
resources/lib/jquery.ui/jquery.ui.button.js on lines 191..193
resources/lib/ooui/oojs-ui-core.js on lines 7435..7435
resources/lib/ooui/oojs-ui-core.js on lines 9587..9589
resources/lib/ooui/oojs-ui-widgets.js on lines 4172..4196
resources/lib/ooui/oojs-ui-widgets.js on lines 4538..4560

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

mw.widgets.TableWidget.prototype.clear = function () {
    this.model.clear();
};
resources/lib/ooui/oojs-ui-core.js on lines 9571..9573
resources/lib/ooui/oojs-ui-core.js on lines 12958..12960
resources/lib/ooui/oojs-ui-widgets.js on lines 3983..3985
resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.js on lines 232..234
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 250..252

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

                this._shortWeekdaysParse[i] = new RegExp(
                    '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
                    'i'
                );
Severity: Major
Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
resources/lib/moment/moment.js on lines 1055..1058
resources/lib/moment/moment.js on lines 1059..1062
resources/lib/moment/moment.js on lines 1661..1664
resources/lib/moment/moment.js on lines 1669..1672

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

OO.ui.mixin.TabIndexedElement.prototype.simulateLabelClick = function () {
    this.focus();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 4 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 2143..2145
resources/lib/ooui/oojs-ui-widgets.js on lines 925..927
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 589..591
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 713..715

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

OO.ui.Window.prototype.getTeardownProcess = function () {
    return new OO.ui.Process();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-windows.js and 3 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-windows.js on lines 2246..2248
resources/lib/ooui/oojs-ui-windows.js on lines 2265..2267
resources/lib/ooui/oojs-ui-windows.js on lines 2284..2286

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

        meridiem: function (hours, minutes, isLower) {
            if (hours > 11) {
                return isLower ? 'p.t.m.' : 'P.T.M.';
            } else {
                return isLower ? 'a.t.m.' : 'A.T.M.';
Severity: Major
Found in resources/lib/moment/locale/eo.js and 5 other locations - About 35 mins to fix
resources/lib/moment/locale/af.js on lines 28..34
resources/lib/moment/locale/el.js on lines 47..53
resources/lib/moment/locale/si.js on lines 68..74
resources/lib/moment/locale/tzl.js on lines 37..43
resources/lib/moment/locale/vi.js on lines 33..39

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

OO.ui.ButtonMenuSelectWidget.prototype.onButtonMenuClick = function () {
    this.menu.toggle();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 5 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 9571..9573
resources/lib/ooui/oojs-ui-core.js on lines 12958..12960
resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.js on lines 232..234
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 243..245
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 250..252

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

                this._minWeekdaysParse[i] = new RegExp(
                    '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
                    'i'
                );
Severity: Major
Found in resources/lib/moment/moment.js and 4 other locations - About 35 mins to fix
resources/lib/moment/moment.js on lines 1055..1058
resources/lib/moment/moment.js on lines 1059..1062
resources/lib/moment/moment.js on lines 1661..1664
resources/lib/moment/moment.js on lines 1665..1668

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

            case 'millisecond|0':
                spec = {
                    component: 'Millisecond',
                    calendarComponent: false,
                    type: 'number',
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 312..320
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 372..380
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 392..400

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

        meridiem: function (hours, minutes, isLower) {
            if (hours < 12) {
                return isLower ? 'vm' : 'VM';
            } else {
                return isLower ? 'nm' : 'NM';
Severity: Major
Found in resources/lib/moment/locale/af.js and 5 other locations - About 35 mins to fix
resources/lib/moment/locale/el.js on lines 47..53
resources/lib/moment/locale/eo.js on lines 38..44
resources/lib/moment/locale/si.js on lines 68..74
resources/lib/moment/locale/tzl.js on lines 37..43
resources/lib/moment/locale/vi.js on lines 33..39

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

    } else if (
        e.keyCode === OO.ui.Keys.LEFT ||
        e.keyCode === OO.ui.Keys.RIGHT
    ) {
        let movement;
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 5 other locations - About 35 mins to fix
resources/lib/jquery.ui/jquery.ui.button.js on lines 191..193
resources/lib/ooui/oojs-ui-core.js on lines 7435..7435
resources/lib/ooui/oojs-ui-core.js on lines 9585..9589
resources/lib/ooui/oojs-ui-core.js on lines 9587..9589
resources/lib/ooui/oojs-ui-widgets.js on lines 4538..4560

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

OO.ui.CheckboxMultioptionWidget.prototype.focus = function () {
    this.checkbox.focus();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 5 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12958..12960
resources/lib/ooui/oojs-ui-widgets.js on lines 3983..3985
resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.js on lines 232..234
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 243..245
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 250..252

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

            case 'millisecond|0':
                spec = {
                    component: 'millisecond',
                    calendarComponent: false,
                    type: 'number',
resources/src/mediawiki.widgets.datetime/DiscordianDateTimeFormatter.js on lines 175..183
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 312..320
resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 372..380

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

            if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
Severity: Minor
Found in resources/lib/jquery.ui/jquery.ui.draggable.js and 2 other locations - About 35 mins to fix
resources/lib/jquery.ui/jquery.ui.draggable.js on lines 769..769
resources/lib/jquery.ui/jquery.ui.draggable.js on lines 769..769

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

                    e.keyCode === OO.ui.Keys.UP || e.keyCode === OO.ui.Keys.LEFT ? -1 : 1,
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 5 other locations - About 35 mins to fix
resources/lib/jquery.ui/jquery.ui.button.js on lines 191..193
resources/lib/ooui/oojs-ui-core.js on lines 9585..9589
resources/lib/ooui/oojs-ui-core.js on lines 9587..9589
resources/lib/ooui/oojs-ui-widgets.js on lines 4172..4196
resources/lib/ooui/oojs-ui-widgets.js on lines 4538..4560

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

OO.ui.mixin.LookupElement.prototype.abortLookupRequest = function () {
    this.abortRequest();
};
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 4 other locations - About 35 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 2143..2145
resources/lib/ooui/oojs-ui-core.js on lines 2231..2233
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 589..591
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 713..715

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

            if (!target) return {
              target: '',
              _targetLowerCodes: [0 /*this 0 doesn't make sense. here because an empty array causes the algorithm to deoptimize and run 50% slower!*/],
              _nextBeginningIndexes: null,
              score: null,
Severity: Minor
Found in resources/lib/qunitjs/qunit.js and 1 other location - About 35 mins to fix
resources/lib/qunitjs/qunit.js on lines 4737..4744

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

Severity
Category
Status
Source
Language