wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method __construct has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct() {
        parent::__construct();

        $this->addDescription(
            "Blocks a list of usernames. Can use STDIN or the file argument.\n\n" .
Severity: Major
Found in maintenance/blockUsers.php - About 2 hrs to fix

    Method checkAll has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function checkAll( $options ) {
            $contLang = $this->getServiceContainer()->getContentLanguage();
            $spaces = [];
    
            // List interwikis first, so they'll be overridden
    Severity: Major
    Found in maintenance/namespaceDupes.php - About 2 hrs to fix

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

          public function execute() {
              global $IP, $wgLocalDatabases;
      
              $username = wfMessage( 'spambot_username' )->text();
              $user = User::newSystemUser( $username );
      Severity: Major
      Found in maintenance/cleanupSpam.php - About 2 hrs to fix

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

                    yieldsToOn: function (prop, context) {
                        if (typeof context !== "object") {
                            throw new TypeError("argument context is not an object");
                        }
        
        
        Severity: Major
        Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
        resources/lib/sinonjs/sinon.js on lines 3323..3335
        resources/lib/sinonjs/sinon.js on lines 3374..3386

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

        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

        Method handleCategorization has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function handleCategorization( IReadableDatabase $dbr, $output ) {
                $processedTitle = [];
        
                // Categorization change can add new parents and change counts
                // for the parent category.
        Severity: Major
        Found in maintenance/categoryChangesAsRdf.php - About 2 hrs to fix

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

                  pluralize = function (u) {
                      return function (number, withoutSuffix, string, isFuture) {
                          var f = pluralForm(number),
                              str = plurals[u][pluralForm(number)];
                          if (f === 2) {
          Severity: Major
          Found in resources/lib/moment/locale/ar.js and 1 other location - About 2 hrs to fix
          resources/lib/moment/locale/ar-ly.js on lines 89..98

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

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

                  pluralize = function (u) {
                      return function (number, withoutSuffix, string, isFuture) {
                          var f = pluralForm(number),
                              str = plurals[u][pluralForm(number)];
                          if (f === 2) {
          Severity: Major
          Found in resources/lib/moment/locale/ar-ly.js and 1 other location - About 2 hrs to fix
          resources/lib/moment/locale/ar.js on lines 103..112

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

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

                      if (
                          searchIsEmpty ||
                          items[ i ].getLabel().toLowerCase().indexOf( query ) > -1 ||
                          items[ i ].getDescription().toLowerCase().indexOf( query ) > -1 ||
                          groupTitle.toLowerCase().indexOf( query ) > -1 ||
          Severity: Major
          Found in resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js and 1 other location - About 2 hrs to fix
          resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js on lines 1039..1051

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

          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

              const paginationStatusMessageShort = computed(() => {
                if (props.pending) {
                  return paginationStatusMessagePending.value;
                } else if (indeterminate.value && nextDisabled.value) {
                  return paginationStatusMessageIndeterminateFinal.value;
          Severity: Major
          Found in resources/lib/codex/codex.js and 1 other location - About 2 hrs to fix
          resources/lib/codex/codex.js on lines 8027..8037

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

          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

          FilterGroup.prototype.areAnySelectedInConflictWith = function ( filterItem ) {
              const selectedItems = this.findSelectedItems( filterItem );
          
              return selectedItems.length > 0 && (
                  // The group as a whole is in conflict with this item
          Severity: Major
          Found in resources/src/mediawiki.rcfilters/dm/FilterGroup.js and 1 other location - About 2 hrs to fix
          resources/src/mediawiki.rcfilters/dm/FilterGroup.js on lines 489..499

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

          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

                      yieldsOn: function (context) {
                          if (typeof context !== "object") {
                              throw new TypeError("argument context is not an object");
                          }
          
          
          Severity: Major
          Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
          resources/lib/sinonjs/sinon.js on lines 3323..3335
          resources/lib/sinonjs/sinon.js on lines 3398..3410

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

          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

              const paginationStatusMessageLong = computed(() => {
                if (props.pending) {
                  return paginationStatusMessagePending.value;
                } else if (indeterminate.value && nextDisabled.value) {
                  return paginationStatusMessageIndeterminateFinal.value;
          Severity: Major
          Found in resources/lib/codex/codex.js and 1 other location - About 2 hrs to fix
          resources/lib/codex/codex.js on lines 8016..8026

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

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

                  if (
                      searchIsEmpty ||
                      items[ i ].getLabel().toLowerCase().indexOf( query ) === 0 ||
                      (
                          // For tags, we want the parameter name to be included in the search
          Severity: Major
          Found in resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js and 1 other location - About 2 hrs to fix
          resources/src/mediawiki.rcfilters/dm/FiltersViewModel.js on lines 1058..1072

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

          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

                      callsArgWith: function callsArgWith(pos) {
                          if (typeof pos !== "number") {
                              throw new TypeError("argument index is not number");
                          }
          
          
          Severity: Major
          Found in resources/lib/sinonjs/sinon.js and 2 other locations - About 2 hrs to fix
          resources/lib/sinonjs/sinon.js on lines 3374..3386
          resources/lib/sinonjs/sinon.js on lines 3398..3410

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

          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

          FilterGroup.prototype.areAllSelectedInConflictWith = function ( filterItem ) {
              const selectedItems = this.findSelectedItems( filterItem );
          
              return selectedItems.length > 0 &&
                  (
          Severity: Major
          Found in resources/src/mediawiki.rcfilters/dm/FilterGroup.js and 1 other location - About 2 hrs to fix
          resources/src/mediawiki.rcfilters/dm/FilterGroup.js on lines 507..516

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

          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 index.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ( function () {
              /**
               * @typedef {Object} mw.Api.Options
               * @property {Object} [parameters = { action: 'query', format: 'json' }] Default query
               *  parameters for API requests
          Severity: Minor
          Found in resources/src/mediawiki.api/index.js - About 2 hrs to fix

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

            <?php
            /** Nupe (Nupe)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesNup.php and 8 other locations - About 2 hrs to fix
            languages/messages/MessagesGd.php on lines 1..25
            languages/messages/MessagesGv.php on lines 1..25
            languages/messages/MessagesIlo.php on lines 1..25
            languages/messages/MessagesJbo.php on lines 1..25
            languages/messages/MessagesKai.php on lines 1..26
            languages/messages/MessagesRw.php on lines 1..28
            languages/messages/MessagesSs.php on lines 1..27
            languages/messages/MessagesXh.php on lines 1..27

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

            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

            <?php
            /** Manx (Gaelg)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesGv.php and 8 other locations - About 2 hrs to fix
            languages/messages/MessagesGd.php on lines 1..25
            languages/messages/MessagesIlo.php on lines 1..25
            languages/messages/MessagesJbo.php on lines 1..25
            languages/messages/MessagesKai.php on lines 1..26
            languages/messages/MessagesNup.php on lines 1..28
            languages/messages/MessagesRw.php on lines 1..28
            languages/messages/MessagesSs.php on lines 1..27
            languages/messages/MessagesXh.php on lines 1..27

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

            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

            <?php
            /** Lojban (lojban)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesJbo.php and 8 other locations - About 2 hrs to fix
            languages/messages/MessagesGd.php on lines 1..25
            languages/messages/MessagesGv.php on lines 1..25
            languages/messages/MessagesIlo.php on lines 1..25
            languages/messages/MessagesKai.php on lines 1..26
            languages/messages/MessagesNup.php on lines 1..28
            languages/messages/MessagesRw.php on lines 1..28
            languages/messages/MessagesSs.php on lines 1..27
            languages/messages/MessagesXh.php on lines 1..27

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

            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

            <?php
            /** Kinyarwanda (Ikinyarwanda)
             *
             * @file
             * @ingroup Languages
            Severity: Major
            Found in languages/messages/MessagesRw.php and 8 other locations - About 2 hrs to fix
            languages/messages/MessagesGd.php on lines 1..25
            languages/messages/MessagesGv.php on lines 1..25
            languages/messages/MessagesIlo.php on lines 1..25
            languages/messages/MessagesJbo.php on lines 1..25
            languages/messages/MessagesKai.php on lines 1..26
            languages/messages/MessagesNup.php on lines 1..28
            languages/messages/MessagesSs.php on lines 1..27
            languages/messages/MessagesXh.php on lines 1..27

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

            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