wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    public function getAllowedParams( $flags = 0 ) {
        $feedFormatNames = array_keys( $this->getConfig()->get( MainConfigNames::FeedClasses ) );
        $ret = [
            'feedformat' => [
                ParamValidator::PARAM_DEFAULT => 'rss',
Severity: Minor
Found in includes/api/ApiFeedWatchlist.php - About 1 hr to fix

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

        public function execute() {
            $params = $this->extractRequestParams();
            $wikiPage = $this->getTitleOrPageId( $params );
            $title = $wikiPage->getTitle();
            $this->getErrorFormatter()->setContextTitle( $title );
    Severity: Minor
    Found in includes/api/ApiChangeContentModel.php - About 1 hr to fix

      Method getFormFields has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getFormFields() {
              $this->addHelpLink( 'Help:What links here' );
              $this->getOutput()->addModuleStyles( 'mediawiki.special' );
      
              $fields = [
      Severity: Minor
      Found in includes/specials/SpecialWhatLinksHere.php - About 1 hr to fix

        Method getActionButtons has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getActionButtons( $formcontents ) {
                $canRevDelete = $this->getAuthority()
                    ->isAllowedAll( 'deletedhistory', 'deletelogentry' );
                $showTagEditUI = ChangeTags::showTagEditingUI( $this->getAuthority() );
                # If the user doesn't have the ability to delete log entries nor edit tags,
        Severity: Minor
        Found in includes/specials/SpecialLog.php - About 1 hr to fix

          Method buildRollbackLink has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function buildRollbackLink(
                  RevisionRecord $revRecord,
                  IContextSource $context = null,
                  $editCount = false
              ) {
          Severity: Minor
          Found in includes/linker/Linker.php - About 1 hr to fix

            Method buildRemoveLine has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function buildRemoveLine( $title, string $expiryDaysText = '' ): string {
                    $linkRenderer = $this->getLinkRenderer();
                    $link = $linkRenderer->makeLink( $title );
            
                    $tools = [];
            Severity: Minor
            Found in includes/specials/SpecialEditWatchlist.php - About 1 hr to fix

              Method exportJS has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function exportJS() {
                      $out = $this->getOutput();
                      $req = $this->getContext()->getRequest();
                      $rl = $out->getResourceLoader();
              
              
              Severity: Minor
              Found in includes/specials/SpecialJavaScriptTest.php - About 1 hr to fix

                Method push has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function push( $jobs ) {
                        $jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
                        if ( $jobs === [] ) {
                            return;
                        }
                Severity: Minor
                Found in includes/jobqueue/JobQueueGroup.php - About 1 hr to fix

                  Method pstPass2 has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function pstPass2( $text, UserIdentity $user ) {
                          # Note: This is the timestamp saved as hardcoded wikitext to the database, we use
                          # $this->contLang here in order to give everyone the same signature and use the default one
                          # rather than the one selected in each user's preferences.  (see also T14815)
                          $ts = $this->mOptions->getTimestamp();
                  Severity: Minor
                  Found in includes/parser/Parser.php - About 1 hr to fix

                    Method newChild has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function newChild( $args = false, $title = false, $indexOffset = 0 ) {
                            $namedArgs = [];
                            $numberedArgs = [];
                            if ( $title === false ) {
                                $title = $this->title;
                    Severity: Minor
                    Found in includes/parser/PPFrame_Hash.php - About 1 hr to fix

                      Method formatParameterValue has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function formatParameterValue( $type, $value ) {
                              $saveLinkFlood = $this->linkFlood;
                      
                              switch ( strtolower( trim( $type ) ) ) {
                                  case 'raw':
                      Severity: Minor
                      Found in includes/logging/LogFormatter.php - About 1 hr to fix

                        Method publish has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function publish( $newId, $to = 'rcandudp' ) {
                                $canAddTags = true;
                                // FIXME: this code should be removed once all callers properly call publish()
                                if ( $to === 'udp' && !$newId && !$this->getAssociatedRevId() ) {
                                    \MediaWiki\Logger\LoggerFactory::getInstance( 'logging' )->warning(
                        Severity: Minor
                        Found in includes/logging/ManualLogEntry.php - About 1 hr to fix

                          Method storeBatch has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function storeBatch( array $triplets, $flags = 0 ) {
                                  $this->assertWritableRepo(); // fail out if read-only
                          
                                  if ( $flags & self::DELETE_SOURCE ) {
                                      throw new InvalidArgumentException( "DELETE_SOURCE not supported in " . __METHOD__ );
                          Severity: Minor
                          Found in includes/filerepo/FileRepo.php - About 1 hr to fix

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

                                public function execute() {
                                    $repo = $this->file->getRepo();
                                    $lockStatus = $this->file->acquireFileLock();
                                    if ( !$lockStatus->isOK() ) {
                                        return $lockStatus;
                            Severity: Minor
                            Found in includes/filerepo/file/LocalFileDeleteBatch.php - About 1 hr to fix

                              Method getBackendPaths has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getBackendPaths( array $paths, $latest = true ) {
                                      $db = $this->getDB( $latest ? DB_PRIMARY : DB_REPLICA );
                              
                                      // @TODO: batching
                                      $resolved = [];
                              Severity: Minor
                              Found in includes/filerepo/FileBackendDBRepoWrapper.php - About 1 hr to fix

                                Method maybeUpgradeRow has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function maybeUpgradeRow() {
                                        if ( MediaWikiServices::getInstance()->getReadOnlyMode()->isReadOnly() || $this->upgrading ) {
                                            return;
                                        }
                                
                                
                                Severity: Minor
                                Found in includes/filerepo/file/LocalFile.php - About 1 hr to fix

                                  Method setProps has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function setProps( $info ) {
                                          $this->dataLoaded = true;
                                          $fields = $this->getCacheFields( '' );
                                          $fields[] = 'fileExists';
                                  
                                  
                                  Severity: Minor
                                  Found in includes/filerepo/file/LocalFile.php - About 1 hr to fix

                                    Method parseNamespacePrefixes has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function parseNamespacePrefixes(
                                            $query,
                                            $withAllKeyword = true,
                                            $withPrefixSearchExtractNamespaceHook = false
                                        ) {
                                    Severity: Minor
                                    Found in includes/search/SearchEngine.php - About 1 hr to fix

                                      Method markPatrolled has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function markPatrolled( Authority $performer, $tags = null ): PermissionStatus {
                                              $services = MediaWikiServices::getInstance();
                                              $mainConfig = $services->getMainConfig();
                                              $useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
                                              $useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
                                      Severity: Minor
                                      Found in includes/recentchanges/RecentChange.php - About 1 hr to fix

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

                                            public function execute() {
                                                $services = $this->getServiceContainer();
                                                $lbFactory = $services->getDBLoadBalancerFactory();
                                                $stats = $services->getStatsFactory();
                                                $lbsByType = [
                                        Severity: Minor
                                        Found in maintenance/getLagTimes.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language