wikimedia/mediawiki-core

View on GitHub

Showing 2,063 of 11,773 total issues

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

    if ( OO.isPlainObject( toolbar ) && config === undefined ) {
        config = toolbar;
        toolbar = config.toolbar;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-toolbars.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

        preparse: function (string) {
            return string
                .replace(/[۰-۹]/g, function (match) {
                    return numberMap[match];
                })
Severity: Major
Found in resources/lib/moment/locale/fa.js and 8 other locations - About 30 mins to fix
resources/lib/moment/locale/ar-ly.js on lines 167..173
resources/lib/moment/locale/ar-sa.js on lines 93..99
resources/lib/moment/locale/ar-sa.js on lines 100..106
resources/lib/moment/locale/ar.js on lines 178..184
resources/lib/moment/locale/ar.js on lines 185..191
resources/lib/moment/locale/fa.js on lines 104..110
resources/lib/moment/locale/ku.js on lines 107..113
resources/lib/moment/locale/ku.js on lines 114..120

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

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

    OO.ui.mixin.TabIndexedElement.call( this, $.extend( {
        $tabIndexed: this.$handle
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 3992..3994
resources/lib/ooui/oojs-ui-core.js on lines 4348..4350
resources/lib/ooui/oojs-ui-core.js on lines 9916..9918
resources/lib/ooui/oojs-ui-core.js on lines 12874..12874
resources/lib/ooui/oojs-ui-toolbars.js on lines 731..733
resources/lib/ooui/oojs-ui-toolbars.js on lines 2097..2099
resources/lib/ooui/oojs-ui-widgets.js on lines 3150..3152

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

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

    if ( OO.isPlainObject( name ) && config === undefined ) {
        config = name;
        name = config.name;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

    if ( OO.isPlainObject( outline ) && config === undefined ) {
        config = outline;
        outline = config.outline;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

        postformat: function (string) {
            return string
                .replace(/\d/g, function (match) {
                    return symbolMap[match];
                })
Severity: Major
Found in resources/lib/moment/locale/fa.js and 8 other locations - About 30 mins to fix
resources/lib/moment/locale/ar-ly.js on lines 167..173
resources/lib/moment/locale/ar-sa.js on lines 93..99
resources/lib/moment/locale/ar-sa.js on lines 100..106
resources/lib/moment/locale/ar.js on lines 178..184
resources/lib/moment/locale/ar.js on lines 185..191
resources/lib/moment/locale/fa.js on lines 97..103
resources/lib/moment/locale/ku.js on lines 107..113
resources/lib/moment/locale/ku.js on lines 114..120

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

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

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

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

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

Refactorings

Further Reading

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

    if (s.sym_next) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
Severity: Major
Found in resources/lib/pako/pako_deflate.js and 3 other locations - About 30 mins to fix
resources/lib/pako/pako_deflate.js on lines 2367..2374
resources/lib/pako/pako_deflate.js on lines 2466..2473
resources/lib/pako/pako_deflate.js on lines 2523..2530

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

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

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

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

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

Refactorings

Further Reading

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

    if (s.sym_next) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
Severity: Major
Found in resources/lib/pako/pako_deflate.js and 3 other locations - About 30 mins to fix
resources/lib/pako/pako_deflate.js on lines 2206..2213
resources/lib/pako/pako_deflate.js on lines 2367..2374
resources/lib/pako/pako_deflate.js on lines 2523..2530

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

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

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

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

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

Refactorings

Further Reading

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

    if (s.sym_next) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
Severity: Major
Found in resources/lib/pako/pako_deflate.js and 3 other locations - About 30 mins to fix
resources/lib/pako/pako_deflate.js on lines 2206..2213
resources/lib/pako/pako_deflate.js on lines 2367..2374
resources/lib/pako/pako_deflate.js on lines 2466..2473

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

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

    OO.ui.mixin.LabelElement.call( this, $.extend( {
        $label: this.$element
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 4252..4254
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 4413..4415
resources/lib/ooui/oojs-ui-core.js on lines 8407..8407
resources/lib/ooui/oojs-ui-core.js on lines 9910..9912
resources/lib/ooui/oojs-ui-core.js on lines 10224..10226
resources/lib/ooui/oojs-ui-widgets.js on lines 3143..3145

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

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

    OO.ui.mixin.TabIndexedElement.call( this, $.extend( {
        $tabIndexed: this.$input
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 4252..4254
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 4413..4415
resources/lib/ooui/oojs-ui-core.js on lines 4494..4496
resources/lib/ooui/oojs-ui-core.js on lines 8407..8407
resources/lib/ooui/oojs-ui-core.js on lines 10224..10226
resources/lib/ooui/oojs-ui-widgets.js on lines 3143..3145

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

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

    if ( OO.isPlainObject( toolGroup ) && config === undefined ) {
        config = toolGroup;
        toolGroup = config.toolGroup;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-toolbars.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

    OO.ui.mixin.IconElement.call( this, $.extend( {
        $icon: this.$element
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 4252..4254
resources/lib/ooui/oojs-ui-core.js on lines 4413..4415
resources/lib/ooui/oojs-ui-core.js on lines 4494..4496
resources/lib/ooui/oojs-ui-core.js on lines 8407..8407
resources/lib/ooui/oojs-ui-core.js on lines 9910..9912
resources/lib/ooui/oojs-ui-core.js on lines 10224..10226
resources/lib/ooui/oojs-ui-widgets.js on lines 3143..3145

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

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

    OO.ui.mixin.TabIndexedElement.call( this, $.extend( {
        $tabIndexed: this.$button
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 3992..3994
resources/lib/ooui/oojs-ui-core.js on lines 4348..4350
resources/lib/ooui/oojs-ui-core.js on lines 8964..8966
resources/lib/ooui/oojs-ui-core.js on lines 9916..9918
resources/lib/ooui/oojs-ui-core.js on lines 12874..12874
resources/lib/ooui/oojs-ui-toolbars.js on lines 731..733
resources/lib/ooui/oojs-ui-toolbars.js on lines 2097..2099

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

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

    OO.ui.mixin.AccessKeyedElement.call( this, $.extend( {
        $accessKeyed: this.$input
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 3992..3994
resources/lib/ooui/oojs-ui-core.js on lines 4348..4350
resources/lib/ooui/oojs-ui-core.js on lines 8964..8966
resources/lib/ooui/oojs-ui-core.js on lines 12874..12874
resources/lib/ooui/oojs-ui-toolbars.js on lines 731..733
resources/lib/ooui/oojs-ui-toolbars.js on lines 2097..2099
resources/lib/ooui/oojs-ui-widgets.js on lines 3150..3152

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

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

    if ( OO.isPlainObject( toolbar ) && config === undefined ) {
        config = toolbar;
        toolbar = config.toolbar;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-toolbars.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

        preparse: function (string) {
            return string
                .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
                    return numberMap[match];
                })
Severity: Major
Found in resources/lib/moment/locale/ar.js and 8 other locations - About 30 mins to fix
resources/lib/moment/locale/ar-ly.js on lines 167..173
resources/lib/moment/locale/ar-sa.js on lines 93..99
resources/lib/moment/locale/ar-sa.js on lines 100..106
resources/lib/moment/locale/ar.js on lines 185..191
resources/lib/moment/locale/fa.js on lines 97..103
resources/lib/moment/locale/fa.js on lines 104..110
resources/lib/moment/locale/ku.js on lines 107..113
resources/lib/moment/locale/ku.js on lines 114..120

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

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

    if ( OO.isPlainObject( name ) && config === undefined ) {
        config = name;
        name = config.name;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249
resources/lib/ooui/oojs-ui-windows.js on lines 637..640

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

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

    if ( OO.isPlainObject( message ) && config === undefined ) {
        config = message;
        message = config.message;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-windows.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 12848..12851
resources/lib/ooui/oojs-ui-toolbars.js on lines 701..704
resources/lib/ooui/oojs-ui-toolbars.js on lines 1097..1100
resources/lib/ooui/oojs-ui-toolbars.js on lines 1702..1705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1803..1806
resources/lib/ooui/oojs-ui-toolbars.js on lines 1996..1999
resources/lib/ooui/oojs-ui-toolbars.js on lines 2059..2062
resources/lib/ooui/oojs-ui-toolbars.js on lines 2513..2516
resources/lib/ooui/oojs-ui-toolbars.js on lines 2752..2755
resources/lib/ooui/oojs-ui-widgets.js on lines 1029..1032
resources/lib/ooui/oojs-ui-widgets.js on lines 1193..1196
resources/lib/ooui/oojs-ui-widgets.js on lines 3246..3249

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

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

    OO.ui.mixin.GroupElement.call( this, $.extend( {
        $group: this.$element
    }, config ) );
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 4413..4415
resources/lib/ooui/oojs-ui-core.js on lines 4494..4496
resources/lib/ooui/oojs-ui-core.js on lines 8407..8407
resources/lib/ooui/oojs-ui-core.js on lines 9910..9912
resources/lib/ooui/oojs-ui-core.js on lines 10224..10226
resources/lib/ooui/oojs-ui-widgets.js on lines 3143..3145

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

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