wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method runMultiHttp has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function runMultiHttp( array $reqs, array $opts = [] ) {
        $httpOptions = [
            'timeout' => $opts['reqTimeout'] ?? $this->reqTimeout,
            'connectTimeout' => $opts['connTimeout'] ?? $this->connTimeout,
            'logger' => $this->logger,
Severity: Major
Found in includes/libs/http/MultiHttpClient.php - About 2 hrs to fix

    Method getMultiWithUnionSetCallback has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        final public function getMultiWithUnionSetCallback(
            ArrayIterator $keyedIds, $ttl, callable $callback, array $opts = []
        ) {
            $checkKeys = $opts['checkKeys'] ?? [];
            $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
    Severity: Major
    Found in includes/libs/objectcache/WANObjectCache.php - About 2 hrs to fix

      Method validate has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function validate( $reader ) {
              // First, move through anything that isn't an element, and
              // handle any processing instructions with the callback
              do {
                  if ( !$this->readNext( $reader ) ) {
      Severity: Major
      Found in includes/libs/mime/XmlTypeCheck.php - About 2 hrs to fix

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

            public function __construct(
                ServiceOptions $options,
                BlockRestrictionStore $blockRestrictionStore,
                BlockPermissionCheckerFactory $blockPermissionCheckerFactory,
                BlockUtils $blockUtils,
        Severity: Major
        Found in includes/block/BlockUser.php - About 2 hrs to fix

          Method getNewRevision has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getNewRevision() {
                  $undoRev = $this->revisionLookup->getRevisionById( $this->undo );
                  $oldRev = $this->revisionLookup->getRevisionById( $this->undoafter );
                  $curRev = $this->curRev;
          
          
          Severity: Major
          Found in includes/actions/McrUndoAction.php - About 2 hrs to fix

            Method getInputOOUI has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getInputOOUI( $value ) {
                    $this->mParent->getOutput()->addModuleStyles( 'mediawiki.widgets.SelectWithInputWidget.styles' );
            
                    $valInSelect = false;
                    if ( $value !== false ) {
            Severity: Major
            Found in includes/htmlform/fields/HTMLSelectOrOtherField.php - About 2 hrs to fix

              Method searchPreferences has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function searchPreferences( $context, &$defaultPreferences ) {
                      $defaultPreferences['search-special-page'] = [
                          'type' => 'api',
                      ];
              
              
              Severity: Major
              Found in includes/preferences/DefaultPreferencesFactory.php - About 2 hrs to fix

                Method animateFilterAndLang has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function animateFilterAndLang( $name ) {
                        $this->debug( "animate filter for tag $name" );
                        if ( $this->reader->nodeType !== XMLReader::ELEMENT ) {
                            return;
                        }
                Severity: Major
                Found in includes/media/SVGReader.php - About 2 hrs to fix

                  Method wfMerge has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function wfMerge(
                      string $old,
                      string $mine,
                      string $yours,
                      ?string &$simplisticMergeAttempt,
                  Severity: Major
                  Found in includes/GlobalFunctions.php - About 2 hrs to fix

                    Method appendInterwikiMap has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function appendInterwikiMap( $property, $filter ) {
                            $local = $filter ? $filter === 'local' : null;
                    
                            $params = $this->extractRequestParams();
                            $langCode = $params['inlanguagecode'] ?? '';
                    Severity: Major
                    Found in includes/api/ApiQuerySiteinfo.php - About 2 hrs to fix

                      Method importScopedSession has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function importScopedSession( array $params ) {
                              if ( strlen( $params['sessionId'] ) &&
                                  SessionManager::getGlobalSession()->isPersistent()
                              ) {
                                  // Check to avoid sending random cookies for the wrong users.
                      Severity: Major
                      Found in includes/context/RequestContext.php - About 2 hrs to fix

                        Method processVerificationError has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function processVerificationError( $details ) {
                                switch ( $details['status'] ) {
                                    /** Statuses that only require name changing */
                                    case UploadBase::MIN_LENGTH_PARTNAME:
                                        $this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );
                        Severity: Major
                        Found in includes/specials/SpecialUpload.php - About 2 hrs to fix

                          Method fetchUser has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function fetchUser( $username, $writing = true ) {
                                  $parts = explode( $this->getConfig()->get( MainConfigNames::UserrightsInterwikiDelimiter ),
                                      $username );
                                  if ( count( $parts ) < 2 ) {
                                      $name = trim( $username );
                          Severity: Major
                          Found in includes/specials/SpecialUserRights.php - About 2 hrs to fix

                            File AllMessagesTablePager.php has 265 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/specials/pagers/AllMessagesTablePager.php - About 2 hrs to fix

                              Method showPermissionInternal has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function showPermissionInternal( array $messages, $action = null ) {
                                      $services = MediaWikiServices::getInstance();
                                      $groupPermissionsLookup = $services->getGroupPermissionsLookup();
                              
                                      // For some actions (read, edit, create and upload), display a "login to do this action"
                              Severity: Major
                              Found in includes/Output/OutputPage.php - About 2 hrs to fix

                                Method addCategoryLinks has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function addCategoryLinks( array $categories ) {
                                        if ( !$categories ) {
                                            return;
                                        }
                                
                                
                                Severity: Major
                                Found in includes/Output/OutputPage.php - About 2 hrs to fix

                                  Method addToDatabase has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function addToDatabase() {
                                          $this->load();
                                          if ( !$this->mToken ) {
                                              $this->setToken(); // init token
                                          }
                                  Severity: Major
                                  Found in includes/user/User.php - About 2 hrs to fix

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

                                        public function execute() {
                                            $performerName = $this->getOption( 'performer', false );
                                            $reason = $this->getOption( 'reason', '' );
                                            $unblocking = $this->getOption( 'unblock', false );
                                            $reblock = $this->hasOption( 'reblock' );
                                    Severity: Major
                                    Found in maintenance/blockUsers.php - About 2 hrs to fix

                                      Method getHelp has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getHelp(): string {
                                              $screenWidth = 80; // TODO: Calculate this!
                                              $tab = "    ";
                                              $descWidth = $screenWidth - ( 2 * strlen( $tab ) );
                                      
                                      
                                      Severity: Major
                                      Found in maintenance/includes/MaintenanceParameters.php - About 2 hrs to fix

                                        File copyFileBackend.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        <?php
                                        /**
                                         * Copy all files in some containers of one backend to another.
                                         *
                                         * This program is free software; you can redistribute it and/or modify
                                        Severity: Minor
                                        Found in maintenance/copyFileBackend.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language