wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method addPageProtectionWarningHeaders has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function addPageProtectionWarningHeaders(
        IntroMessageList $messages,
        MessageLocalizer $localizer,
        ProperPageIdentity $page
    ): void {
Severity: Minor
Found in includes/editpage/IntroMessageBuilder.php - About 1 hr to fix

    Method importLogItem has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function importLogItem() {
            $services = MediaWikiServices::getInstance();
            $dbw = $services->getConnectionProvider()->getPrimaryDatabase();
    
            $userName = $this->getUser();
    Severity: Minor
    Found in includes/import/WikiRevision.php - About 1 hr to fix

      Method freeLocksOnServer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function freeLocksOnServer( $lockSrv, array $pathsByType ) {
              $status = StatusValue::newGood();
      
              $memc = $this->getCache( $lockSrv );
              // List of affected paths
      Severity: Minor
      Found in includes/libs/lockmanager/MemcLockManager.php - About 1 hr to fix

        Method doGetFileContentsMulti has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function doGetFileContentsMulti( array $params ) {
                $ep = array_diff_key( $params, [ 'srcs' => 1 ] ); // for error logging
                // Blindly create tmp files and stream to them, catching any exception
                // if the file does not exist. Do not waste time doing file stats here.
                $reqs = []; // (path => op)
        Severity: Minor
        Found in includes/libs/filebackend/SwiftFileBackend.php - About 1 hr to fix

          Method tryNormaliseRedirect has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function tryNormaliseRedirect( Title $title ): bool {
                  $request = $this->getRequest();
                  $output = $this->getOutput();
          
                  if ( $request->getRawVal( 'action', 'view' ) != 'view'
          Severity: Minor
          Found in includes/actions/ActionEntryPoint.php - About 1 hr to fix

            Method buildTagFilterSelector has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function buildTagFilterSelector(
                    $selected = '', $ooui = false, IContextSource $context = null
                ) {
                    if ( !$context ) {
                        $context = RequestContext::getMain();
            Severity: Minor
            Found in includes/changetags/ChangeTags.php - About 1 hr to fix

              Method getInputCodex has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getInputCodex( $value, $hasErrors ) {
                      // Figure out the value of the select.
                      $valInSelect = false;
                      if ( $value !== false ) {
                          $value = strval( $value );
              Severity: Minor
              Found in includes/htmlform/fields/HTMLSelectOrOtherField.php - About 1 hr to fix

                Method extractPageRecord has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function extractPageRecord( $externalData, $pageTitle ) {
                        // If there is a special case with only one returned page
                        // we can cheat, and only return
                        // the single page in the "pages" substructure.
                        if ( isset( $externalData['query']['pages'] ) ) {
                Severity: Minor
                Found in includes/site/MediaWikiPageNameNormalizer.php - About 1 hr to fix

                  Method capturePath has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function capturePath(
                          PageReference $page, IContextSource $context, LinkRenderer $linkRenderer = null
                      ) {
                          // phpcs:ignore MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgUser
                          global $wgTitle, $wgOut, $wgRequest, $wgUser, $wgLang;
                  Severity: Minor
                  Found in includes/specialpage/SpecialPageFactory.php - About 1 hr to fix

                    Method doQuery has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function doQuery( array $userIds, $options = [], $caller = '' ) {
                            $usersToCheck = [];
                            $usersToQuery = [];
                    
                            $userIds = array_unique( $userIds );
                    Severity: Minor
                    Found in includes/cache/UserCache.php - About 1 hr to fix

                      Method addResultToCache has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function addResultToCache( $cache, $res ) {
                              if ( !$res ) {
                                  return [];
                              }
                      
                      
                      Severity: Minor
                      Found in includes/cache/LinkBatch.php - About 1 hr to fix

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

                            public function getAllowedParams() {
                                $config = $this->getConfig();
                                $feedFormatNames = array_keys( $config->get( MainConfigNames::FeedClasses ) );
                        
                                return [
                        Severity: Minor
                        Found in includes/api/ApiFeedRecentChanges.php - About 1 hr to fix

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

                              public function getAllowedParams() {
                                  $ret = parent::getAllowedParams() + [
                                      'user' => [
                                          ParamValidator::PARAM_TYPE => 'user',
                                          UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'temp', 'id', 'interwiki' ],
                          Severity: Minor
                          Found in includes/api/ApiQueryAllRevisions.php - About 1 hr to fix

                            Method tryShowFile has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function tryShowFile( $archiveName ) {
                                    $repo = $this->repoGroup->getLocalRepo();
                                    $oimage = $repo->newFromArchiveName( $this->targetObj, $archiveName );
                                    $oimage->load();
                                    // Check if user is allowed to see this file
                            Severity: Minor
                            Found in includes/specials/SpecialRevisionDelete.php - About 1 hr to fix

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

                                  protected function getFormFields() {
                                      $fields = [
                                          'pagetitle' => [
                                              'type' => 'title',
                                              'creatable' => true,
                              Severity: Minor
                              Found in includes/specials/SpecialChangeContentModel.php - About 1 hr to fix

                                Method reallyDoQuery has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function reallyDoQuery( $limit, $offset = false ) {
                                        $fname = static::class . '::reallyDoQuery';
                                        $dbr = $this->getRecacheDB();
                                        $query = $this->getQueryInfo();
                                        $conds = isset( $query['conds'] ) ? (array)$query['conds'] : [];
                                Severity: Minor
                                Found in includes/specials/SpecialShortPages.php - About 1 hr to fix

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

                                      protected function getFormFields( User $target ) {
                                          $linkRenderer = $this->getLinkRenderer();
                                          $user = $this->getUser();
                                          return [
                                              'From' => [
                                  Severity: Minor
                                  Found in includes/specials/SpecialEmailUser.php - About 1 hr to fix

                                    Method showUploads has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function showUploads() {
                                            // sets the title, etc.
                                            $this->setHeaders();
                                            $this->outputHeader();
                                    
                                    
                                    Severity: Minor
                                    Found in includes/specials/SpecialUploadStash.php - About 1 hr to fix

                                      Method showDeleteTagForm has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function showDeleteTagForm( $tag ) {
                                              $authority = $this->getAuthority();
                                              if ( !$authority->isAllowed( 'deletechangetags' ) ) {
                                                  throw new PermissionsError( 'deletechangetags' );
                                              }
                                      Severity: Minor
                                      Found in includes/specials/SpecialTags.php - About 1 hr to fix

                                        Method runForTitle has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function runForTitle( PageIdentity $pageIdentity ) {
                                                $services = MediaWikiServices::getInstance();
                                                $stats = $services->getStatsFactory();
                                                $renderer = $services->getRevisionRenderer();
                                                $parserCache = $services->getParserCache();
                                        Severity: Minor
                                        Found in includes/jobqueue/jobs/RefreshLinksJob.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language