wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function OoUiTagMultiselectWidget has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

OO.ui.TagMultiselectWidget = function OoUiTagMultiselectWidget( config ) {
    const rAF = window.requestAnimationFrame || setTimeout,
        $tabFocus = $( '<span>' ).addClass( 'oo-ui-tagMultiselectWidget-focusTrap' );

    config = config || {};
Severity: Major
Found in resources/lib/ooui/oojs-ui-widgets.js - About 4 hrs to fix

    Function parseTemplate has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function parseTemplate (template, tags) {
        if (!template)
          return [];
        var lineHasNonSpace = false;
        var sections = [];     // Stack to hold section tokens
    Severity: Major
    Found in resources/lib/mustache/mustache.js - About 4 hrs to fix

      Method runSecondQuery has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function runSecondQuery( $resultPageSet = null ) {
              $db = $this->getDB();
              if ( isset( $this->linksMigration::$mapping[$this->bl_table] ) ) {
                  $queryInfo = $this->linksMigration->getQueryInfo( $this->bl_table, $this->bl_table );
                  $this->addTables( $queryInfo['tables'] );
      Severity: Major
      Found in includes/api/ApiQueryBacklinks.php - About 4 hrs to fix

        Method run has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function run( $resultPageSet = null ) {
                $pages = $this->getPageSet()->getGoodPages();
                if ( $pages === [] ) {
                    return; // nothing to do
                }
        Severity: Major
        Found in includes/api/ApiQueryLinks.php - About 4 hrs to fix

          Method showPrefixChunk has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function showPrefixChunk( $namespace, $prefix, $from = null ) {
                  $from ??= $prefix;
          
                  $fromList = $this->getNamespaceKeyAndText( $namespace, $from );
                  $prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix );
          Severity: Major
          Found in includes/specials/SpecialPrefixIndex.php - About 4 hrs to fix

            File Category.php has 336 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Representation for a category.
             *
             * This program is free software; you can redistribute it and/or modify
            Severity: Minor
            Found in includes/Category/Category.php - About 4 hrs to fix

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

                      if ( !this.shortDayNames ) {
                          this.shortDayNames = {
                              0: mw.msg( 'sun' ),
                              1: mw.msg( 'mon' ),
                              2: mw.msg( 'tue' ),
              resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 235..245

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

              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

                    createVNode(_component_cdx_button, {
                      disabled: _ctx.prevDisabled,
                      class: "cdx-table-pager__button-first",
                      weight: "quiet",
                      "aria-label": _ctx.btnLabelFirst,
              Severity: Major
              Found in resources/lib/codex/codex.js and 2 other locations - About 4 hrs to fix
              resources/lib/codex/codex.js on lines 7674..7686
              resources/lib/codex/codex.js on lines 7687..7699

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

              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

                          nextWeek: function (now) {
                              if (now.week() !== this.week()) {
                                  switch (this.day()) {
                                      case 0:
                                          return '[В следующее] dddd, [в] LT';
              Severity: Major
              Found in resources/lib/moment/locale/ru.js and 1 other location - About 4 hrs to fix
              resources/lib/moment/locale/ru.js on lines 135..156

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

              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

                    createVNode(_component_cdx_button, {
                      disabled: _ctx.prevDisabled,
                      class: "cdx-table-pager__button-prev",
                      weight: "quiet",
                      "aria-label": _ctx.btnLabelPrev,
              Severity: Major
              Found in resources/lib/codex/codex.js and 2 other locations - About 4 hrs to fix
              resources/lib/codex/codex.js on lines 7661..7673
              resources/lib/codex/codex.js on lines 7687..7699

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

              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

                    createVNode(_component_cdx_button, {
                      disabled: _ctx.nextDisabled,
                      class: "cdx-table-pager__button-next",
                      weight: "quiet",
                      "aria-label": _ctx.btnLabelNext,
              Severity: Major
              Found in resources/lib/codex/codex.js and 2 other locations - About 4 hrs to fix
              resources/lib/codex/codex.js on lines 7661..7673
              resources/lib/codex/codex.js on lines 7674..7686

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

              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 ( !this.fullDayNames ) {
                          this.fullDayNames = {
                              0: mw.msg( 'sunday' ),
                              1: mw.msg( 'monday' ),
                              2: mw.msg( 'tuesday' ),
              resources/src/mediawiki.widgets.datetime/ProlepticGregorianDateTimeFormatter.js on lines 246..256

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

              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

                          lastWeek: function (now) {
                              if (now.week() !== this.week()) {
                                  switch (this.day()) {
                                      case 0:
                                          return '[В прошлое] dddd, [в] LT';
              Severity: Major
              Found in resources/lib/moment/locale/ru.js and 1 other location - About 4 hrs to fix
              resources/lib/moment/locale/ru.js on lines 113..134

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

              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

              Function getFieldForTag has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  mw.widgets.datetime.ProlepticGregorianDateTimeFormatter.prototype.getFieldForTag = function ( tag, params ) {
                      let spec = null;
              
                      switch ( tag + '|' + params[ 0 ] ) {
                          case 'year|#':

                Function unsafeInfuse has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                OO.ui.Element.static.unsafeInfuse = function ( elem, config, domPromise ) {
                    // look for a cached result of a previous infusion.
                    let $elem = $( elem );
                
                    if ( $elem.length > 1 ) {
                Severity: Major
                Found in resources/lib/ooui/oojs-ui-core.js - About 4 hrs to fix

                  Method view has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function view() {
                          $context = $this->getContext();
                          $showEXIF = $context->getConfig()->get( MainConfigNames::ShowEXIF );
                  
                          // For action=render, include body text only; none of the image extras
                  Severity: Major
                  Found in includes/page/ImagePage.php - About 4 hrs to fix

                    Method makeList has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function makeList( array $a, $mode = self::LIST_COMMA ) {
                            $first = true;
                            $list = '';
                            $keyWarning = null;
                    
                    
                    Severity: Major
                    Found in includes/libs/rdbms/platform/SQLPlatform.php - About 4 hrs to fix

                      File ConverterRule.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * This program is free software; you can redistribute it and/or modify
                       * it under the terms of the GNU General Public License as published by
                       * the Free Software Foundation; either version 2 of the License, or
                      Severity: Minor
                      Found in includes/language/ConverterRule.php - About 4 hrs to fix

                        Method run has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function run( $resultPageSet = null ) {
                                $params = $this->extractRequestParams();
                        
                                $this->addTables( 'protected_titles' );
                                $this->addFields( [ 'pt_namespace', 'pt_title', 'pt_timestamp' ] );
                        Severity: Major
                        Found in includes/api/ApiQueryProtectedTitles.php - About 4 hrs to fix

                          Method optionsPanel has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function optionsPanel( $defaults, $nondefaults, $numRows ) {
                                  $options = $nondefaults + $defaults;
                          
                                  $note = '';
                                  $msg = $this->msg( 'rclegend' );
                          Severity: Major
                          Found in includes/specials/SpecialRecentChanges.php - About 4 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language