wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method translateBlockExpiry has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function translateBlockExpiry( $str, UserIdentity $user = null, $now = 0 ) {
        /*
            'ago', 'now', 'today', 'this', 'next',
            'first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'eighth', 'ninth',
                'tenth', 'eleventh', 'twelfth',
Severity: Major
Found in includes/languages/LanguageFi.php - About 2 hrs to fix

    Method getTemplateData has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getTemplateData(): array {
            $name = $this->name;
            // Monobook and Vector historically render this portal as an element with ID p-cactions.
            // To ensure compatibility with gadgets, it is renamed accordingly.
            // @todo Port p-#cactions to #p-actions and drop these conditionals.
    Severity: Major
    Found in includes/skins/components/SkinComponentMenu.php - About 2 hrs to fix

      Method updateTagsWithChecks has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
              $rc_id, $rev_id, $log_id, $params, string $reason, Authority $performer
          ) {
              if ( !$tagsToAdd && !$tagsToRemove ) {
                  // no-op, don't bother
      Severity: Major
      Found in includes/changetags/ChangeTags.php - About 2 hrs to fix

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

            private function validate( $section, $tag, $val, $recursive = false ): bool {
                $debug = "tag is '$tag'";
                $etype = $this->mExifTags[$section][$tag];
                $ecount = 1;
                if ( is_array( $etype ) ) {
        Severity: Major
        Found in includes/media/Exif.php - About 2 hrs to fix

          Method readExtension has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function readExtension( $fullJsonFile, $extDeps = [], $skinDeps = [] ) {
                  $load = [
                      $fullJsonFile => 1
                  ];
                  if ( $extDeps ) {
          Severity: Major
          Found in includes/installer/Installer.php - About 2 hrs to fix

            Method initFromRevIDs has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function initFromRevIDs( $revids ) {
                    if ( !$revids ) {
                        return;
                    }
            
            
            Severity: Major
            Found in includes/api/ApiPageSet.php - About 2 hrs to fix

              Method diffHeader has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function diffHeader( RevisionRecord $revRecord, $prefix ) {
                      if ( $revRecord instanceof RevisionArchiveRecord ) {
                          // Revision in the archive table, only viewable via this special page
                          $targetPage = $this->getPageTitle();
                          $targetQuery = [
              Severity: Major
              Found in includes/specials/SpecialUndelete.php - About 2 hrs to fix

                Method run has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function run() {
                        $services = MediaWikiServices::getInstance();
                        $lbFactory = $services->getDBLoadBalancerFactory();
                        $lb = $lbFactory->getMainLB();
                        $dbw = $lb->getConnection( DB_PRIMARY );
                Severity: Major
                Found in includes/jobqueue/jobs/CategoryMembershipChangeJob.php - About 2 hrs to fix

                  Method getFileInfo has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFileInfo( IPageConfig $pageConfig, array $files ): array {
                          $page = Title::newFromLinkTarget( $pageConfig->getLinkTarget() );
                  
                          $keys = [];
                          foreach ( $files as $f ) {
                  Severity: Major
                  Found in includes/parser/Parsoid/Config/DataAccess.php - About 2 hrs to fix

                    Method getThumbUrlFromCache has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
                            // We can't check the local cache using FileRepo functions because
                            // we override fileExistsBatch(). We have to use the FileBackend directly.
                            $backend = $this->getBackend(); // convenience
                    
                    
                    Severity: Major
                    Found in includes/filerepo/ForeignAPIRepo.php - About 2 hrs to fix

                      Method doContentModelChange has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function doContentModelChange(
                              IContextSource $context,
                              string $comment,
                              $bot
                          ) {
                      Severity: Major
                      Found in includes/content/ContentModelChange.php - About 2 hrs to fix

                        Method insertElement has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function insertElement( $preposition, $refElement, Element $element, $void,
                                $sourceStart, $sourceLength
                            ) {
                                [ $parent, $newRef ] = $this->getParentForInsert( $preposition, $refElement );
                                $parentData = $parent->snData;
                        Severity: Major
                        Found in includes/tidy/RemexCompatMunger.php - About 2 hrs to fix

                          Method getAutoDeleteReason has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getAutoDeleteReason( Title $title, &$hasHistory = false ) {
                                  if ( func_num_args() === 2 ) {
                                      wfDeprecated( __METHOD__ . ': $hasHistory parameter', '1.38' );
                                  }
                                  $dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
                          Severity: Major
                          Found in includes/content/ContentHandler.php - About 2 hrs to fix

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

                                public function execute() {
                                    $repo = $this->getServiceContainer()->getRepoGroup()->getLocalRepo();
                                    $start = str_replace( ' ', '_', $this->getOption( 'start', '' ) ); // page on img_name
                                    $end = str_replace( ' ', '_', $this->getOption( 'end', '' ) ); // page on img_name
                                    // filter by img_media_type
                            Severity: Major
                            Found in maintenance/refreshFileHeaders.php - About 2 hrs to fix

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

                                  public function execute() {
                                      $dbw = $this->getPrimaryDB();
                              
                                      // Autodetect mode...
                                      if ( $this->hasOption( 'background' ) ) {
                              Severity: Major
                              Found in maintenance/initEditCount.php - About 2 hrs to fix

                                File SpecialAllPages.php has 271 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/SpecialAllPages.php - About 2 hrs to fix

                                  File LinksUpdate.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  /**
                                   * Updater for link tracking tables after a page edit.
                                   *
                                   * This program is free software; you can redistribute it and/or modify
                                  Severity: Minor
                                  Found in includes/deferred/LinksUpdate/LinksUpdate.php - About 2 hrs to fix

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

                                            Title $oldTitle,
                                            Title $newTitle,
                                            ServiceOptions $options,
                                            IConnectionProvider $dbProvider,
                                            NamespaceInfo $nsInfo,
                                    Severity: Major
                                    Found in includes/page/MovePage.php - About 2 hrs to fix

                                      WikiModule has 23 functions (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class WikiModule extends Module {
                                          /** @var string Origin defaults to users with sitewide authority */
                                          protected $origin = self::ORIGIN_USER_SITEWIDE;
                                      
                                          /**
                                      Severity: Minor
                                      Found in includes/ResourceLoader/WikiModule.php - About 2 hrs to fix

                                        WikiExporter has 23 functions (exceeds 20 allowed). Consider refactoring.
                                        Open

                                        class WikiExporter {
                                            /** @var bool Return distinct author list (when not returning full history) */
                                            public $list_authors = false;
                                        
                                            /** @var bool */
                                        Severity: Minor
                                        Found in includes/export/WikiExporter.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language