wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

            } else {
                ii = indexOf.call(this._longMonthsParse, llc);
                if (ii !== -1) {
                    return ii;
                }
Severity: Major
Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
resources/lib/moment/moment.js on lines 1017..1024

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

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

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

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

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

Refactorings

Further Reading

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

            if (format === 'MMM') {
                ii = indexOf.call(this._shortMonthsParse, llc);
                if (ii !== -1) {
                    return ii;
                }
Severity: Major
Found in resources/lib/moment/moment.js and 1 other location - About 1 hr to fix
resources/lib/moment/moment.js on lines 1024..1031

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

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

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

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

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

Refactorings

Further Reading

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

            if ( oRange === "max" && this.orientation === "horizontal" ) {
                this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
            }
Severity: Major
Found in resources/lib/jquery.ui/jquery.ui.slider.js and 1 other location - About 1 hr to fix
resources/lib/jquery.ui/jquery.ui.slider.js on lines 636..638

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

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

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

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

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

Refactorings

Further Reading

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

        case "End":
          maybePrevent();
          if (props.expanded) {
            if (highlightedMenuItem.value === null) {
              handleMenuItemChange("highlightedViaKeyboard", findFirstSelectedMenuItem());
Severity: Major
Found in resources/lib/codex/codex.js and 1 other location - About 1 hr to fix
resources/lib/codex/codex.js on lines 2938..2949

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

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

$namespaceAliases = [
    'نقاش' => NS_TALK,
    'مستخدم' => NS_USER,
    'مستخدمة' => NS_USER, // Feminine form from Standard Arabic
    'نقاش_المستخدم' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesAry.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    'Speciaal' => NS_SPECIAL,
    'Overleg' => NS_TALK,
    'Gebruiker' => NS_USER,
    'Overleg_gebruiker' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesSrn.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    'Көдлхнə'                 => NS_SPECIAL,
    'Ухалвр'                  => NS_TALK,
    'Орлцач'                  => NS_USER,
    'Орлцачна_тускар_ухалвр'  => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesXal.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49

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

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

$namespaceAliases = [
    'Diskussion' => NS_TALK,
    'Benutzer' => NS_USER,
    'Benutzer_Diskussion' => NS_USER_TALK,
    '$1_Diskussion' => NS_PROJECT_TALK,
Severity: Major
Found in languages/messages/MessagesNds.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    // Aliases from old Persian (fa) namespace names
    'ویژه' => NS_SPECIAL,
    'بحث' => NS_TALK,
    'کاربر' => NS_USER,
Severity: Major
Found in languages/messages/MessagesGlk.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    'Specialus'             => NS_SPECIAL,
    'Aptarimas'             => NS_TALK,
    'Naudotojas'            => NS_USER,
    'Naudotojo_aptarimas'   => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesSgs.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    'ਖਾਸ' => NS_SPECIAL,
    'ਚਰਚਾ' => NS_TALK,
    'ਮੈਂਬਰ' => NS_USER,
    'ਮੈਂਬਰ_ਚਰਚਾ' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesPa.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

$namespaceAliases = [
    // 'id' namespace names at the time 'bjn' namespaces were localised.
    'Istimewa'              => NS_SPECIAL,
    'Pembicaraan'           => NS_TALK,
    'Pengguna'              => NS_USER,
Severity: Major
Found in languages/messages/MessagesBjn.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNap.php on lines 38..53
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

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

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

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

Refactorings

Further Reading

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

        if ( !isset( $data['help'] ) ) {
            $data['help'] = new RawMessage( '$1', $data['name'] );
        } elseif ( is_string( $data['help'] ) ) {
            $data['help'] = new Message( $data['help'] );
        } elseif ( is_array( $data['help'] ) && $data['help'] ) {
Severity: Major
Found in includes/auth/ButtonAuthenticationRequest.php and 1 other location - About 1 hr to fix
includes/auth/ButtonAuthenticationRequest.php on lines 101..108

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

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

$namespaceAliases = [
    'Speciale' => NS_SPECIAL,
    'Discussione' => NS_TALK,
    'Utente' => NS_USER,
    'Discussioni_utente' => NS_USER_TALK,
Severity: Major
Found in languages/messages/MessagesNap.php and 8 other locations - About 1 hr to fix
languages/messages/MessagesAry.php on lines 31..46
languages/messages/MessagesBjn.php on lines 29..45
languages/messages/MessagesGlk.php on lines 31..47
languages/messages/MessagesNds.php on lines 39..54
languages/messages/MessagesPa.php on lines 47..62
languages/messages/MessagesSgs.php on lines 39..54
languages/messages/MessagesSrn.php on lines 34..49
languages/messages/MessagesXal.php on lines 35..50

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

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

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

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

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

Refactorings

Further Reading

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

        'default' => [
            'newpage' => [
                'letter' => 'newpageletter',
                'title' => 'recentchanges-label-newpage',
                'legend' => 'recentchanges-legend-newpage',
Severity: Major
Found in includes/MainConfigSchema.php and 1 other location - About 1 hr to fix
includes/config-schema.php on lines 2021..2048

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

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

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

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

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

Refactorings

Further Reading

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

        MEDIATYPE_BITMAP => [
            'image/x-bmp',
            'image/x-ms-bmp',
            'image/bmp',
            'image/gif',
Severity: Major
Found in includes/libs/mime/MimeMap.php and 1 other location - About 1 hr to fix
includes/installer/LocalSettingsGenerator.php on lines 64..77

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

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

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

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

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

Refactorings

Further Reading

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

        if ( !isset( $data['label'] ) ) {
            $data['label'] = new RawMessage( '$1', $data['name'] );
        } elseif ( is_string( $data['label'] ) ) {
            $data['label'] = new Message( $data['label'] );
        } elseif ( is_array( $data['label'] ) && $data['label'] ) {
Severity: Major
Found in includes/auth/ButtonAuthenticationRequest.php and 1 other location - About 1 hr to fix
includes/auth/ButtonAuthenticationRequest.php on lines 109..116

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

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

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

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

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

Refactorings

Further Reading

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

        if ( $params['categories'] ) {
            $cats = [];
            foreach ( $params['categories'] as $cat ) {
                $title = Title::newFromText( $cat );
                if ( !$title || $title->getNamespace() !== NS_CATEGORY ) {
Severity: Major
Found in includes/api/ApiQueryCategories.php and 1 other location - About 1 hr to fix
includes/api/ApiQueryImages.php on lines 92..107

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

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

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

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

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

Refactorings

Further Reading

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

        if ( $params['images'] ) {
            $images = [];
            foreach ( $params['images'] as $img ) {
                $title = Title::newFromText( $img );
                if ( !$title || $title->getNamespace() !== NS_FILE ) {
Severity: Major
Found in includes/api/ApiQueryImages.php and 1 other location - About 1 hr to fix
includes/api/ApiQueryCategories.php on lines 79..94

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

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

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

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

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

Refactorings

Further Reading

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

            'RecentChangesFlags' => [
                'newpage' => [
                    'letter' => 'newpageletter',
                    'title' => 'recentchanges-label-newpage',
                    'legend' => 'recentchanges-legend-newpage',
Severity: Major
Found in includes/config-schema.php and 1 other location - About 1 hr to fix
includes/MainConfigSchema.php on lines 10796..10823

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

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