wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method tagObj has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function tagObj( $parser, $frame, $args ) {
        if ( !count( $args ) ) {
            return '';
        }
        $tagName = strtolower( trim( $frame->expand( array_shift( $args ) ) ) );
Severity: Minor
Found in includes/parser/CoreParserFunctions.php - About 1 hr to fix

    Method getParametersForApi has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getParametersForApi() {
            $entry = $this->entry;
            $params = $entry->getParameters();
    
            static $map = [
    Severity: Minor
    Found in includes/logging/RightsLogFormatter.php - About 1 hr to fix

      Method loadFromCache has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function loadFromCache() {
              global $wgFullyInitialised;
      
              $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
              $data = $cache->getWithSetCallback(
      Severity: Minor
      Found in includes/user/User.php - About 1 hr to fix

        Method saveOptionsInternal has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function saveOptionsInternal( UserIdentity $user ): bool {
                if ( $this->userNameUtils->isIP( $user->getName() ) || $this->userNameUtils->isTemp( $user->getName() ) ) {
                    throw new InvalidArgumentException( __METHOD__ . ' was called on IP or temporary user' );
                }
        
        
        Severity: Minor
        Found in includes/user/Options/UserOptionsManager.php - About 1 hr to fix

          Method getHistory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getHistory( $limit = null, $start = null, $end = null, $inc = true ) {
                  if ( !$this->exists() ) {
                      return []; // Avoid hard failure when the file does not exist. T221812
                  }
          
          
          Severity: Minor
          Found in includes/filerepo/file/LocalFile.php - About 1 hr to fix

            Method publishTo has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function publishTo( $src, $dstRel, $flags = 0, array $options = [] ) {
                    $srcPath = ( $src instanceof FSFile ) ? $src->getPath() : $src;
            
                    $repo = $this->getRepo();
                    if ( $repo->getReadOnlyReason() !== false ) {
            Severity: Minor
            Found in includes/filerepo/file/LocalFile.php - About 1 hr to fix

              Method openSink has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function openSink() {
                      if ( !$this->uri ) {
                          throw new LogicException(
                              'Missing stream uri, the stream can not be opened.' );
                      }
              Severity: Minor
              Found in includes/debug/logger/monolog/LegacyHandler.php - About 1 hr to fix

                Method makeIndexes has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function makeIndexes( $url, $reverseDomain = true ) {
                        // NOTE: refreshExternallinksIndex.php assumes that only protocol-relative URLs return more
                        // than one index, and that the indexes for protocol-relative URLs only vary in the "http://"
                        // versus "https://" prefix. If you change that, you'll likely need to update
                        // refreshExternallinksIndex.php accordingly.
                Severity: Minor
                Found in includes/ExternalLinks/LinkFilter.php - About 1 hr to fix

                  Method checkPolicies has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function checkPolicies( UserIdentity $user, $password, $policies, $policyCheckFunctions ) {
                          $status = Status::newGood( [] );
                          $forceChange = false;
                          $suggestChangeOnLogin = false;
                          $legacyUser = MediaWikiServices::getInstance()
                  Severity: Minor
                  Found in includes/password/UserPasswordPolicy.php - About 1 hr to fix

                    Method getMessage has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getMessage( StatusValue $status, array $options = [] ) {
                            $shortContext = $options['shortContext'] ?? null;
                            $longContext = $options['longContext'] ?? null;
                            $lang = $options['lang'] ?? null;
                    
                    
                    Severity: Minor
                    Found in includes/Status/StatusFormatter.php - About 1 hr to fix

                      Method processCompletionResults has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function processCompletionResults( $search, SearchSuggestionSet $suggestions ) {
                              // We over-fetched to determine pagination. Shrink back down if we have extra results
                              // and mark if pagination is possible
                              $suggestions->shrink( $this->limit );
                      
                      
                      Severity: Minor
                      Found in includes/search/SearchEngine.php - About 1 hr to fix

                        Method importRevision has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function importRevision( $revision ) {
                                $id = $revision->getID();
                                $content = $revision->getContent();
                                $id = $id ?: '';
                        
                        
                        Severity: Minor
                        Found in maintenance/storage/checkStorage.php - About 1 hr to fix

                          Method checkSqlSyntax has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function checkSqlSyntax( $files ) {
                                  if ( !self::isPresent() ) {
                                      throw new RuntimeException( "Can't check SQL syntax: SQLite not found" );
                                  }
                                  if ( !is_array( $files ) ) {
                          Severity: Minor
                          Found in maintenance/Sqlite.php - About 1 hr to fix

                            Method processRevision has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function processRevision( WikiRevision $rev ) {
                                    $title = $rev->getTitle();
                            
                                    $parser1Name = $this->getOption( 'parser1' );
                                    $parser2Name = $this->getOption( 'parser2' );
                            Severity: Minor
                            Found in maintenance/compareParsers.php - About 1 hr to fix

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

                                  protected function doDBUpdates() {
                                      $dbw = $this->getDB( DB_PRIMARY );
                                      $mapping = \MediaWiki\Linker\LinksMigration::$mapping;
                                      $table = $this->getOption( 'table', '' );
                                      if ( !isset( $mapping[$table] ) ) {
                              Severity: Minor
                              Found in maintenance/migrateLinksTable.php - About 1 hr to fix

                                Method handleBatch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function handleBatch( $lowId ) {
                                        $batchSize = $this->getBatchSize();
                                        // range is inclusive, let's subtract one.
                                        $highId = $lowId + $batchSize - 1;
                                        $dbw = $this->getPrimaryDB();
                                Severity: Minor
                                Found in maintenance/migrateExternallinks.php - About 1 hr to fix

                                  Method runTable has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function runTable( $params ) {
                                          $dbr = $this->getReplicaDB();
                                  
                                          if ( array_diff( array_keys( $params ),
                                              [ 'table', 'conds', 'index', 'callback' ] )
                                  Severity: Minor
                                  Found in maintenance/TableCleanup.php - About 1 hr to fix

                                    Method validateParamsAndArgs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function validateParamsAndArgs() {
                                            $error_out = false;
                                    
                                            # Get the format and make sure it is set to a valid default value
                                            $format = strtolower( $this->getOption( 'format', 'PHP' ) );
                                    Severity: Minor
                                    Found in maintenance/getConfiguration.php - About 1 hr to fix

                                      Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              ServiceOptions $options,
                                              IConnectionProvider $dbProvider,
                                              UserFactory $userFactory,
                                              ReadOnlyMode $readOnlyMode,
                                              RevisionStore $revisionStore,
                                      Severity: Major
                                      Found in includes/page/RollbackPage.php - About 1 hr to fix

                                        Method __construct has 13 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                ILBFactory $dbLoadBalancerFactory,
                                                BlobStoreFactory $blobStoreFactory,
                                                NameTableStoreFactory $nameTables,
                                                SlotRoleRegistry $slotRoleRegistry,
                                                WANObjectCache $cache,
                                        Severity: Major
                                        Found in includes/Revision/RevisionStoreFactory.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language