wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

( function ( $ ) {
    'use strict';

    $.i18n.languages.hsb = $.extend( {}, $.i18n.languages[ 'default' ], {
        convertGrammar: function ( word, form ) {
Severity: Major
Found in resources/lib/jquery.i18n/src/languages/hsb.js and 2 other locations - About 3 hrs to fix
resources/lib/jquery.i18n/src/languages/bs.js on lines 5..23
resources/lib/jquery.i18n/src/languages/dsb.js on lines 5..23

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

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

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

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

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

Refactorings

Further Reading

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

        }, createSlots({
          default: withCtx(() => [
            renderSlot(_ctx.$slots, "default")
          ]),
          _: 2
Severity: Major
Found in resources/lib/codex/codex.js and 3 other locations - About 3 hrs to fix
resources/lib/codex/codex.js on lines 6264..6278
resources/lib/codex/codex.js on lines 7045..7059
resources/lib/codex/codex.js on lines 9503..9517

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

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

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

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

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

Refactorings

Further Reading

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

( function ( $ ) {
    'use strict';

    $.i18n.languages.bs = $.extend( {}, $.i18n.languages[ 'default' ], {
        convertGrammar: function ( word, form ) {
Severity: Major
Found in resources/lib/jquery.i18n/src/languages/bs.js and 2 other locations - About 3 hrs to fix
resources/lib/jquery.i18n/src/languages/dsb.js on lines 5..23
resources/lib/jquery.i18n/src/languages/hsb.js on lines 5..22

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

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

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

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

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

Refactorings

Further Reading

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

        }, createSlots({
          default: withCtx(() => [
            renderSlot(_ctx.$slots, "default")
          ]),
          _: 2
Severity: Major
Found in resources/lib/codex/codex.js and 3 other locations - About 3 hrs to fix
resources/lib/codex/codex.js on lines 1444..1458
resources/lib/codex/codex.js on lines 6264..6278
resources/lib/codex/codex.js on lines 9503..9517

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

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

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

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

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

Refactorings

Further Reading

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

      }, createSlots({
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "label")
        ]),
        _: 2
Severity: Major
Found in resources/lib/codex/codex.js and 3 other locations - About 3 hrs to fix
resources/lib/codex/codex.js on lines 1444..1458
resources/lib/codex/codex.js on lines 7045..7059
resources/lib/codex/codex.js on lines 9503..9517

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

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

OO.ui.ComboBoxInputWidget.prototype.updateControlsDisabled = function () {
    const disabled = this.isDisabled() || this.isReadOnly();
    if ( this.dropdownButton ) {
        this.dropdownButton.setDisabled( disabled );
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
resources/lib/ooui/oojs-ui-core.js on lines 14027..14036

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

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

OO.ui.NumberInputWidget.prototype.updateControlsDisabled = function () {
    const disabled = this.isDisabled() || this.isReadOnly();
    if ( this.minusButton ) {
        this.minusButton.setDisabled( disabled );
    }
Severity: Major
Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 3 hrs to fix
resources/lib/ooui/oojs-ui-core.js on lines 12704..12713

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

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

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

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

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

Refactorings

Further Reading

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

      }, createSlots({
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 2
Severity: Major
Found in resources/lib/codex/codex.js and 3 other locations - About 3 hrs to fix
resources/lib/codex/codex.js on lines 1444..1458
resources/lib/codex/codex.js on lines 6264..6278
resources/lib/codex/codex.js on lines 7045..7059

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

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

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

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

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

Refactorings

Further Reading

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

( function ( $ ) {
    'use strict';

    $.i18n.languages.dsb = $.extend( {}, $.i18n.languages[ 'default' ], {
        convertGrammar: function ( word, form ) {
Severity: Major
Found in resources/lib/jquery.i18n/src/languages/dsb.js and 2 other locations - About 3 hrs to fix
resources/lib/jquery.i18n/src/languages/bs.js on lines 5..23
resources/lib/jquery.i18n/src/languages/hsb.js on lines 5..22

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

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

File LogPager.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Contain classes to list log entries
 *
 * Copyright © 2004 Brooke Vibber <bvibber@wikimedia.org>
Severity: Minor
Found in includes/logging/LogPager.php - About 3 hrs to fix

    Function setup has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      setup(props, { emit, attrs }) {
        const handle = ref();
        const menu = ref();
        const descriptionId = inject(FieldDescriptionIdKey, void 0);
        const menuId = useGeneratedId("select-menu");
    Severity: Major
    Found in resources/lib/codex/codex.js - About 3 hrs to fix

      Function makeApi has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function makeApi(sinon) {
              var push = [].push;
      
              function exposeValue(sandbox, config, key, value) {
                  if (!value) {
      Severity: Major
      Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

        Function go has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  go: function go(search, targets, options) {
                    if (search == 'farzher') return [{
                      target: "farzher was here (^-^*)/",
                      score: 0,
                      indexes: [0, 1, 2, 3, 4, 5, 6],
        Severity: Major
        Found in resources/lib/qunitjs/qunit.js - About 3 hrs to fix

          Function Animation has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Animation( elem, properties, options ) {
              var result,
                  stopped,
                  index = 0,
                  length = Animation.prefilters.length,
          Severity: Major
          Found in resources/lib/jquery/jquery.js - About 3 hrs to fix

            Method composeCommonMailtext has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function composeCommonMailtext( MessageCache $messageCache ) {
                    $services = MediaWikiServices::getInstance();
                    $config = $services->getMainConfig();
                    $userOptionsLookup = $services->getUserOptionsLookup();
                    $urlUtils = $services->getUrlUtils();
            Severity: Major
            Found in includes/mail/EmailNotification.php - About 3 hrs to fix

              Method sendEmailUnsafe has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function sendEmailUnsafe(
                      UserEmailContact $target,
                      string $subject,
                      string $text,
                      bool $CCMe,
              Severity: Major
              Found in includes/mail/EmailUser.php - About 3 hrs to fix

                Method checkSettings has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function checkSettings( string $name, $settings, array $options ): array {
                        $settings = $this->normalizeSettingsInternal( $settings );
                        $issues = [];
                        $allowedKeys = [
                            self::PARAM_TYPE, self::PARAM_DEFAULT, self::PARAM_REQUIRED, self::PARAM_ISMULTI,
                Severity: Major
                Found in includes/libs/ParamValidator/ParamValidator.php - About 3 hrs to fix

                  Method getCoreUpdateList has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function getCoreUpdateList() {
                          return [
                              // 1.36
                              [ 'modifyField', 'content', 'content_id', 'patch-content-content_id-fix_not_null.sql' ],
                              [ 'modifyField', 'redirect', 'rd_title', 'patch-redirect-rd_title-varbinary.sql' ],
                  Severity: Major
                  Found in includes/installer/SqliteUpdater.php - About 3 hrs to fix

                    Method getAllowedParams has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getAllowedParams() {
                            $slotRoles = $this->slotRoleRegistry->getKnownRoles();
                            sort( $slotRoles, SORT_STRING );
                    
                            return [
                    Severity: Major
                    Found in includes/api/ApiQueryRecentChanges.php - About 3 hrs to fix

                      Method execute has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function execute() {
                              $this->useTransactionalTimeLimit();
                      
                              $params = $this->extractRequestParams();
                              $rotation = $params['rotation'];
                      Severity: Major
                      Found in includes/api/ApiImageRotate.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language