wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method initialize has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function initialize( $mode = self::LOAD_ONLY ) {
        if ( $this->mName === null && $this->mID === null ) {
            throw new RuntimeException( __METHOD__ . ' has both names and IDs null' );
        } elseif ( $this->mID === null ) {
            $where = [ 'cat_title' => $this->mName ];
Severity: Major
Found in includes/Category/Category.php - About 2 hrs to fix

    Method fetchFirstLetterData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function fetchFirstLetterData() {
            // Generate data from serialized data file
            if ( isset( self::TAILORING_FIRST_LETTERS[$this->locale] ) ) {
                $letters = require __DIR__ . "/data/first-letters-root.php";
                // Append additional characters
    Severity: Major
    Found in includes/collation/IcuCollation.php - About 2 hrs to fix

      Method searchQuery has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function searchQuery( $term, $fulltext ) {
              # Get the SQL fragment for the given term
              $searchstring = $this->parseQuery( $term );
      
              // We need a separate query here so gin does not complain about empty searches
      Severity: Major
      Found in includes/search/SearchPostgres.php - About 2 hrs to fix

        Method newForCategorization has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function newForCategorization(
                $timestamp,
                PageIdentity $categoryTitle,
                ?UserIdentity $user,
                $comment,
        Severity: Major
        Found in includes/recentchanges/RecentChange.php - About 2 hrs to fix

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

              public function execute() {
                  $this->output( "Looking for pages with page_latest set to 0...\n" );
                  $dbw = $this->getPrimaryDB();
                  $conds = [ 'page_latest' => 0 ];
                  if ( $this->hasOption( 'regenerate-all' ) ) {
          Severity: Major
          Found in maintenance/attachLatest.php - About 2 hrs to fix

            Method scanRevisionsByTimestamp has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function scanRevisionsByTimestamp( $fromTimestamp, $total ) {
                    $count = 0;
                    $lastRevId = 0;
                    $firstRevId = 0;
                    $lastTimestamp = $fromTimestamp;
            Severity: Major
            Found in maintenance/findBadBlobs.php - About 2 hrs to fix

              Method doDBUpdates has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function doDBUpdates() {
                      $batchSize = $this->getBatchSize();
              
                      $dbw = $this->getDB( DB_PRIMARY );
                      if ( !$dbw->fieldExists( 'revision', 'rev_comment_id', __METHOD__ ) ) {
              Severity: Major
              Found in maintenance/migrateRevisionCommentTemp.php - About 2 hrs to fix

                File WatchlistManager.php has 251 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
                Severity: Minor
                Found in includes/watchlist/WatchlistManager.php - About 2 hrs to fix

                  File MessagesSa.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /** Sanskrit (संस्कृतम्)
                   *
                   * @file
                   * @ingroup Languages
                  Severity: Minor
                  Found in languages/messages/MessagesSa.php - About 2 hrs to fix

                    File MessagesPt_br.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /** Brazilian Portuguese (português do Brasil)
                     *
                     * @file
                     * @ingroup Languages
                    Severity: Minor
                    Found in languages/messages/MessagesPt_br.php - About 2 hrs to fix

                      Function onModelUpdate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      ChangesListWrapperWidget.prototype.onModelUpdate = function (
                          $changesListContent, $fieldset, noResultsDetails, isInitialDOM, from
                      ) {
                          const $message = $( '<div>' )
                                  .addClass( 'mw-rcfilters-ui-changesListWrapperWidget-results' ),
                      Severity: Minor
                      Found in resources/src/mediawiki.rcfilters/ui/ChangesListWrapperWidget.js - About 2 hrs to fix

                        Function getBoundingClientRect has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
                          if (includeScale === void 0) {
                            includeScale = false;
                          }
                          if (isFixedStrategy === void 0) {
                        Severity: Minor
                        Found in resources/lib/codex/codex.js - About 2 hrs to fix

                          Function internalStop has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              internalStop: function internalStop() {
                                var requiredCalls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
                                config.blocking = true;
                                var test = this;
                                var pauseId = this.nextPauseId++;
                          Severity: Minor
                          Found in resources/lib/qunitjs/qunit.js - About 2 hrs to fix

                            Function toolbarChanged has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function toolbarChanged() {
                                  var field = this;
                                  var params = {};
                            
                                  // Detect if field is a select menu or a checkbox
                            Severity: Minor
                            Found in resources/lib/qunitjs/qunit.js - About 2 hrs to fix

                              Function configFromISO has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function configFromISO(config) {
                                      var i,
                                          l,
                                          string = config._i,
                                          match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
                              Severity: Minor
                              Found in resources/lib/moment/moment.js - About 2 hrs to fix

                                Function select has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function select( selector, context, results, seed ) {
                                    var i, tokens, token, type, find,
                                        compiled = typeof selector === "function" && selector,
                                        match = !seed && tokenize( ( selector = compiled.selector || selector ) );
                                
                                
                                Severity: Minor
                                Found in resources/lib/jquery/jquery.js - About 2 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                  if ( ( mappedTypes || origType === handleObj.origType ) &&
                                                      ( !handler || handler.guid === handleObj.guid ) &&
                                                      ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                                      ( !selector || selector === handleObj.selector ||
                                                          selector === "**" && handleObj.selector ) ) {
                                  Severity: Critical
                                  Found in resources/lib/jquery/jquery.js - About 2 hrs to fix

                                    Function OoUiTool has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    OO.ui.Tool = function OoUiTool( toolGroup, config ) {
                                        // Allow passing positional parameters inside the config object
                                        if ( OO.isPlainObject( toolGroup ) && config === undefined ) {
                                            config = toolGroup;
                                            toolGroup = config.toolGroup;
                                    Severity: Minor
                                    Found in resources/lib/ooui/oojs-ui-toolbars.js - About 2 hrs to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
                                                  var c = $(o.containment);
                                                  var ce = c[0]; if(!ce) return;
                                                  var co = c.offset();
                                                  var over = ($(ce).css("overflow") != 'hidden');
                                      Severity: Critical
                                      Found in resources/lib/jquery.ui/jquery.ui.draggable.js - About 2 hrs to fix

                                        Function _mouseCapture has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            _mouseCapture: function( event ) {
                                                var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
                                                    that = this,
                                                    o = this.options;
                                        
                                        
                                        Severity: Minor
                                        Found in resources/lib/jquery.ui/jquery.ui.slider.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language