wikimedia/mediawiki-core

View on GitHub

Showing 2,068 of 11,779 total issues

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

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 233..235
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 244..246
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 251..253

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 233..235
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 244..246
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 251..253

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._fullWeekdaysParse[i] = new RegExp(
                    '^' + this.weekdays(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 1665..1668
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 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 ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
                        $( this ).addClass( "ui-state-active" );
                    }
Severity: Major
Found in resources/lib/jquery.ui/jquery.ui.button.js and 5 other locations - About 35 mins to fix
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 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.RowWidget.prototype.clear = function () {
    this.model.clear();
};
Severity: Major
Found in resources/src/mediawiki.widgets/Table/mw.widgets.RowWidget.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/lib/ooui/oojs-ui-widgets.js on lines 3983..3985
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 244..246
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 251..253

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 ? 'μμ' : 'ΜΜ';
            } else {
                return isLower ? 'πμ' : 'ΠΜ';
Severity: Major
Found in resources/lib/moment/locale/el.js and 5 other locations - About 35 mins to fix
resources/lib/moment/locale/af.js on lines 28..34
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

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 233..235
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 251..253

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

        meridiem: function (hours, minutes, isLower) {
            if (hours > 11) {
                return isLower ? "d'o" : "D'O";
            } else {
                return isLower ? "d'a" : "D'A";
Severity: Major
Found in resources/lib/moment/locale/tzl.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/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

mw.widgets.TableWidget.prototype.clearWithProperties = function () {
    this.model.clearWithProperties();
};
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 233..235
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 244..246

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 590..592
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 714..716

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.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 233..235
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 244..246
resources/src/mediawiki.widgets/Table/mw.widgets.TableWidget.js on lines 251..253

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 4172..4196

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._shortMonthsParse[i] = new RegExp(
                    '^' + this.monthsShort(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 1661..1664
resources/lib/moment/moment.js on lines 1665..1668
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.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 590..592
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 714..716

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

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

    mw.widgets.datetime.DateTimeInputWidget.prototype.onFieldChange = function () {
        this.updateValueFromFields();
    };
resources/lib/ooui/oojs-ui-core.js on lines 2143..2145
resources/lib/ooui/oojs-ui-core.js on lines 2231..2233
resources/lib/ooui/oojs-ui-widgets.js on lines 925..927
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js on lines 590..592

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