wikimedia/mediawiki-core

View on GitHub

Showing 11,461 of 11,461 total issues

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

    if ( OO.isPlainObject( fieldWidget ) && config === undefined ) {
        config = fieldWidget;
        fieldWidget = config.fieldWidget;
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 12 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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

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 3984..3986
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 8946..8948
resources/lib/ooui/oojs-ui-core.js on lines 9892..9894
resources/lib/ooui/oojs-ui-core.js on lines 12830..12830
resources/lib/ooui/oojs-ui-toolbars.js on lines 732..734
resources/lib/ooui/oojs-ui-toolbars.js on lines 2098..2100

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 3984..3986
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 8946..8948
resources/lib/ooui/oojs-ui-core.js on lines 12830..12830
resources/lib/ooui/oojs-ui-toolbars.js on lines 732..734
resources/lib/ooui/oojs-ui-toolbars.js on lines 2098..2100
resources/lib/ooui/oojs-ui-widgets.js on lines 3140..3142

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239

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.ButtonElement.call( this, $.extend( {
        $button: 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 4242..4244
resources/lib/ooui/oojs-ui-core.js on lines 4328..4330
resources/lib/ooui/oojs-ui-core.js on lines 4403..4405
resources/lib/ooui/oojs-ui-core.js on lines 4484..4486
resources/lib/ooui/oojs-ui-core.js on lines 8391..8391
resources/lib/ooui/oojs-ui-core.js on lines 9886..9888
resources/lib/ooui/oojs-ui-widgets.js on lines 3133..3135

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 3984..3986
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 9892..9894
resources/lib/ooui/oojs-ui-core.js on lines 12830..12830
resources/lib/ooui/oojs-ui-toolbars.js on lines 732..734
resources/lib/ooui/oojs-ui-toolbars.js on lines 2098..2100
resources/lib/ooui/oojs-ui-widgets.js on lines 3140..3142

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.TitledElement.call( this, $.extend( { $titled: this.$label }, 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 3984..3986
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 8946..8948
resources/lib/ooui/oojs-ui-core.js on lines 9892..9894
resources/lib/ooui/oojs-ui-toolbars.js on lines 732..734
resources/lib/ooui/oojs-ui-toolbars.js on lines 2098..2100
resources/lib/ooui/oojs-ui-widgets.js on lines 3140..3142

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 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/ku.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/fa.js on lines 104..110
resources/lib/moment/locale/ku.js on lines 107..113

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/ar-sa.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.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/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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2514..2517
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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 12804..12807
resources/lib/ooui/oojs-ui-toolbars.js on lines 702..705
resources/lib/ooui/oojs-ui-toolbars.js on lines 1098..1101
resources/lib/ooui/oojs-ui-toolbars.js on lines 1703..1706
resources/lib/ooui/oojs-ui-toolbars.js on lines 1804..1807
resources/lib/ooui/oojs-ui-toolbars.js on lines 1997..2000
resources/lib/ooui/oojs-ui-toolbars.js on lines 2060..2063
resources/lib/ooui/oojs-ui-toolbars.js on lines 2753..2756
resources/lib/ooui/oojs-ui-widgets.js on lines 1023..1026
resources/lib/ooui/oojs-ui-widgets.js on lines 1187..1190
resources/lib/ooui/oojs-ui-widgets.js on lines 3236..3239
resources/lib/ooui/oojs-ui-windows.js on lines 636..639

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

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-toolbars.js and 7 other locations - About 30 mins to fix
resources/lib/ooui/oojs-ui-core.js on lines 3984..3986
resources/lib/ooui/oojs-ui-core.js on lines 4338..4340
resources/lib/ooui/oojs-ui-core.js on lines 8946..8948
resources/lib/ooui/oojs-ui-core.js on lines 9892..9894
resources/lib/ooui/oojs-ui-core.js on lines 12830..12830
resources/lib/ooui/oojs-ui-toolbars.js on lines 732..734
resources/lib/ooui/oojs-ui-widgets.js on lines 3140..3142

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