wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    public function getAllowedParams() {
        $ret = parent::getAllowedParams() + [
            'startid' => [
                ParamValidator::PARAM_TYPE => 'integer',
                ApiBase::PARAM_HELP_MSG_INFO => [ [ 'singlepageonly' ] ],
Severity: Minor
Found in includes/api/ApiQueryRevisions.php - About 1 hr to fix

    Method showUploadProgress has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function showUploadProgress( $options ) {
            // $isActive = $options['active'] ?? false;
            //$progressBarProperty = $isActive ? '' : 'disabled';
            $message = $this->msg( $options['msg'] )->escaped();
            $destUrl = $this->mRequest->getText( 'wpDestUrl', '' );
    Severity: Minor
    Found in includes/specials/SpecialUpload.php - About 1 hr to fix

      Method formatRow has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function formatRow( $row ) {
              $revRecord = $this->revisionStore->newRevisionFromRow( $row );
      
              $linkRenderer = $this->getLinkRenderer();
      
      
      Severity: Minor
      Found in includes/specials/pagers/MergeHistoryPager.php - About 1 hr to fix

        Method buildForm has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function buildForm() {
                $groups = $this->userGroupManager->listAllGroups();
        
                $options = [];
                $lang = $this->getLanguage();
        Severity: Minor
        Found in includes/specials/SpecialActiveUsers.php - About 1 hr to fix

          Method toString has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function toString() {
                  $paramString = '';
                  if ( $this->params ) {
                      foreach ( $this->params as $key => $value ) {
                          if ( $paramString != '' ) {
          Severity: Minor
          Found in includes/jobqueue/Job.php - About 1 hr to fix

            Method parse has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function parse( string $timeCorrection, int $systemOffset ) {
                    $data = explode( '|', $timeCorrection, 3 );
            
                    // First handle the case of an actual timezone being specified.
                    if ( $data[0] === self::ZONEINFO ) {
            Severity: Minor
            Found in includes/user/UserTimeCorrection.php - About 1 hr to fix

              Method findFile has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function findFile( $title, $options = [] ) {
                      if ( !is_array( $options ) ) {
                          // MW 1.15 compat
                          $options = [ 'time' => $options ];
                      }
              Severity: Minor
              Found in includes/filerepo/RepoGroup.php - About 1 hr to fix

                Method render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render(
                        $term,
                        $offset,
                        ISearchResultSet $titleResultSet = null,
                        ISearchResultSet $textResultSet = null
                Severity: Minor
                Found in includes/search/searchwidgets/BasicSearchResultSetWidget.php - About 1 hr to fix

                  Method notifyEdit has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function notifyEdit(
                          $timestamp, $page, $minor, $user, $comment, $oldId, $lastTimestamp,
                          $bot, $ip = '', $oldSize = 0, $newSize = 0, $newId = 0, $patrol = 0,
                          $tags = [], EditResult $editResult = null
                      ) {
                  Severity: Minor
                  Found in includes/recentchanges/RecentChange.php - About 1 hr to fix

                    Method purgeRedundantText has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function purgeRedundantText( $delete = true ) {
                            # Data should come off the master, wrapped in a transaction
                            $dbw = $this->getPrimaryDB();
                            $this->beginTransaction( $dbw, __METHOD__ );
                    
                    
                    Severity: Minor
                    Found in maintenance/includes/Maintenance.php - About 1 hr to fix

                      Method showSortKeySizeHistogram has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function showSortKeySizeHistogram() {
                              if ( !$this->sizeHistogram ) {
                                  return;
                              }
                              $maxLength = max( array_keys( $this->sizeHistogram ) );
                      Severity: Minor
                      Found in maintenance/updateCollation.php - About 1 hr to fix

                        Method handlePageBatch has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function handlePageBatch( $lowPageId, $mapping, $table ) {
                                $batchSize = $this->getBatchSize();
                                $targetColumn = $mapping[$table]['target_id'];
                                $pageIdColumn = $mapping[$table]['page_id'];
                                // range is inclusive, let's subtract one.
                        Severity: Minor
                        Found in maintenance/migrateLinksTable.php - About 1 hr to fix

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

                              const highlightedId = computed(() => {
                                var _a, _b;
                                return (_b = (_a = menu.value) == null ? void 0 : _a.getHighlightedMenuItem()) == null ? void 0 : _b.id;
                              });
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 3 other locations - About 1 hr to fix
                          resources/lib/codex/codex.js on lines 5244..5247
                          resources/lib/codex/codex.js on lines 6518..6521
                          resources/lib/codex/codex.js on lines 9806..9809

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

                              const highlightedId = computed(() => {
                                var _a, _b;
                                return (_b = (_a = menu.value) == null ? void 0 : _a.getHighlightedMenuItem()) == null ? void 0 : _b.id;
                              });
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 3 other locations - About 1 hr to fix
                          resources/lib/codex/codex.js on lines 5244..5247
                          resources/lib/codex/codex.js on lines 6518..6521
                          resources/lib/codex/codex.js on lines 7412..7415

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

                              const highlightedId = computed(() => {
                                var _a, _b;
                                return (_b = (_a = menu.value) == null ? void 0 : _a.getHighlightedMenuItem()) == null ? void 0 : _b.id;
                              });
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 3 other locations - About 1 hr to fix
                          resources/lib/codex/codex.js on lines 6518..6521
                          resources/lib/codex/codex.js on lines 7412..7415
                          resources/lib/codex/codex.js on lines 9806..9809

                          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

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

                              function onKeydown(e) {
                                if (!menu.value || computedDisabled.value || props.menuItems.length === 0 || e.key === " ") {
                                  return;
                                }
                                menu.value.delegateKeyNavigation(e);
                          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 6825..6830

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

                              const highlightedId = computed(() => {
                                var _a, _b;
                                return (_b = (_a = menu.value) == null ? void 0 : _a.getHighlightedMenuItem()) == null ? void 0 : _b.id;
                              });
                          Severity: Major
                          Found in resources/lib/codex/codex.js and 3 other locations - About 1 hr to fix
                          resources/lib/codex/codex.js on lines 5244..5247
                          resources/lib/codex/codex.js on lines 7412..7415
                          resources/lib/codex/codex.js on lines 9806..9809

                          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

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

                              function onKeydown(e) {
                                if (!menu.value || computedDisabled.value || props.menuItems.length === 0 || e.key === " ") {
                                  return;
                                }
                                menu.value.delegateKeyNavigation(e);
                          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 5291..5296

                          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 === "vertical" ) {
                                          this.range[ animate ? "animate" : "css" ]( { height: ( 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 630..632

                          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 "Home":
                                    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 2950..2961

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language