wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method isValidMove has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function isValidMove() {
        $status = new Status();

        if ( $this->oldTitle->equals( $this->newTitle ) ) {
            $status->fatal( 'selfmove' );
Severity: Major
Found in includes/page/MovePage.php - About 2 hrs to fix

    Method getBody has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getBody() {
            $s = '';
            $this->doQuery();
            if ( count( $this->mHist ) ) {
                if ( $this->mImg->isLocal() ) {
    Severity: Major
    Found in includes/page/ImageHistoryPseudoPager.php - About 2 hrs to fix

      Method getEmptySessionInternal has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function getEmptySessionInternal( WebRequest $request = null, $id = null ) {
              if ( $id !== null ) {
                  if ( !self::validateSessionId( $id ) ) {
                      throw new InvalidArgumentException( 'Invalid session ID' );
                  }
      Severity: Major
      Found in includes/session/SessionManager.php - About 2 hrs to fix

        Method getPreloadedContentFromParams has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getPreloadedContentFromParams(
                ProperPageIdentity $contextPage,
                Authority $performer,
                ?string $preload,
                array $preloadParams
        Severity: Major
        Found in includes/editpage/PreloadedContentBuilder.php - About 2 hrs to fix

          Method getRevisionHeader has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getRevisionHeader( RevisionRecord $rev, $complete = '' ) {
                  $lang = $this->getLanguage();
                  $user = $this->getUser();
                  $revtimestamp = $rev->getTimestamp();
                  $timestamp = $lang->userTimeAndDate( $revtimestamp, $user );
          Severity: Major
          Found in includes/diff/DifferenceEngine.php - About 2 hrs to fix

            Method initializeClient has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function initializeClient( Memcached $client, array $params ) {
                    if ( $client->getServerList() ) {
                        $this->logger->debug( __METHOD__ . ": pre-initialized client instance." );
            
                        return; // preserve persistent handle
            Severity: Major
            Found in includes/libs/objectcache/MemcachedPeclBagOStuff.php - About 2 hrs to fix

              Method awaitSessionPrimaryPos has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function awaitSessionPrimaryPos( $index, $timeout = null ) {
                      $timeout = max( 1, intval( $timeout ?: self::MAX_WAIT_DEFAULT ) );
              
                      if ( !$this->waitForPos || $index === ServerInfo::WRITER_INDEX ) {
                          return true;
              Severity: Major
              Found in includes/libs/rdbms/loadbalancer/LoadBalancer.php - About 2 hrs to fix

                Method placeBlockInternal has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function placeBlockInternal( bool $reblock = true ): Status {
                        $block = $this->configureBlock();
                
                        $denyReason = [ 'hookaborted' ];
                        $legacyUser = $this->userFactory->newFromAuthority( $this->performer );
                Severity: Major
                Found in includes/block/BlockUser.php - About 2 hrs to fix

                  Method getOOUI has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getOOUI( $value ) {
                          $inputField = $this->getInputOOUI( $value );
                  
                          if ( !$inputField ) {
                              // This field doesn't have an OOUI implementation yet at all. Fall back to getDiv() to
                  Severity: Major
                  Found in includes/htmlform/HTMLFormField.php - About 2 hrs to fix

                    Method getSizeAndMetadataWithFallback has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        final public function getSizeAndMetadataWithFallback( $file, $path ) {
                            if ( !$this->useLegacyMetadata() ) {
                                if ( $file instanceof MediaHandlerState ) {
                                    $state = $file;
                                } else {
                    Severity: Major
                    Found in includes/media/MediaHandler.php - About 2 hrs to fix

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

                          public function execute() {
                              $user = $this->getUserForUpdatesOrNull();
                              if ( !$user || !$user->isNamed() ) {
                                  $this->dieWithError(
                                      [ 'apierror-mustbeloggedin', $this->msg( 'action-editmyoptions' ) ], 'notloggedin'
                      Severity: Major
                      Found in includes/api/ApiOptionsBase.php - About 2 hrs to fix

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

                            public function execute() {
                                $this->useTransactionalTimeLimit();
                        
                                $params = $this->extractRequestParams();
                        
                        
                        Severity: Major
                        Found in includes/api/ApiDelete.php - About 2 hrs to fix

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

                              public function execute( $par ) {
                                  $this->setHeaders();
                                  $this->outputHeader();
                                  $this->getOutput()->addModuleStyles( 'mediawiki.special' );
                          
                          
                          Severity: Major
                          Found in includes/specials/SpecialPagesWithProp.php - About 2 hrs to fix

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

                                public function execute( $par ) {
                                    $this->getOutput()->disable();
                            
                                    if ( $this->readOnlyMode->isReadOnly() ) {
                                        wfHttpError( 423, 'Locked', 'Wiki is in read-only mode.' );
                            Severity: Major
                            Found in includes/specials/SpecialRunJobs.php - About 2 hrs to fix

                              Method doMainQuery has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function doMainQuery( $tables, $fields, $conds, $query_options,
                                      $join_conds, FormOptions $opts
                                  ) {
                                      $dbr = $this->getDB();
                              
                              
                              Severity: Major
                              Found in includes/specials/SpecialRecentChanges.php - About 2 hrs to fix

                                Method makeBrokenImageLinkObj has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function makeBrokenImageLinkObj(
                                        $title, $label = '', $query = '', $unused1 = '', $unused2 = '',
                                        $time = false, array $handlerParams = [], bool $currentExists = false
                                    ) {
                                        if ( !$title instanceof LinkTarget ) {
                                Severity: Major
                                Found in includes/linker/Linker.php - About 2 hrs to fix

                                  Method get has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function get( PageRecord $page, $popts, $useOutdated = false ) {
                                          $page->assertWiki( PageRecord::LOCAL );
                                  
                                          if ( !$page->exists() ) {
                                              $this->incrementStats( $page, 'miss', 'nonexistent' );
                                  Severity: Major
                                  Found in includes/parser/ParserCache.php - About 2 hrs to fix

                                    Method getHashes has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function getHashes( StatusValue $status ): array {
                                            $hashes = [];
                                            [ $oldRels, $deleteCurrent ] = $this->getOldRels();
                                    
                                            if ( $deleteCurrent ) {
                                    Severity: Major
                                    Found in includes/filerepo/file/LocalFileDeleteBatch.php - About 2 hrs to fix

                                      Method getQueryConditions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function getQueryConditions( $filterEntry, array $options = [] ) {
                                              $options += [
                                                  'protocol' => [ 'http://', 'https://' ],
                                                  'oneWildcard' => false,
                                                  'db' => null,
                                      Severity: Major
                                      Found in includes/ExternalLinks/LinkFilter.php - About 2 hrs to fix

                                        Method runMysql has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function runMysql( $info, $dbName ) {
                                                // Write the password to an option file to avoid disclosing it to other
                                                // processes running on the system
                                                $tmpFile = TempFSFile::factory( 'mw-mysql', 'ini' );
                                                chmod( $tmpFile->getPath(), 0600 );
                                        Severity: Major
                                        Found in maintenance/mysql.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language