wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

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

    private function writeUpload( $file, $dumpContents = false ) {
        if ( $file->isOld() ) {
            /** @var OldLocalFile $file */
            '@phan-var OldLocalFile $file';
            $archiveName = "      " .
Severity: Minor
Found in includes/export/XmlDumpWriter.php - About 1 hr to fix

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

        public function doUpdate() {
            // Do extensive checks, as the update may be carried out even months after the edit
            if ( !$this->shouldExecute() ) {
                return;
            }
    Severity: Minor
    Found in includes/Storage/RevertedTagUpdate.php - About 1 hr to fix

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

          protected function doCopyInternal( array $params ) {
              $status = $this->newStatus();
      
              [ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $params['src'] );
              if ( $srcRel === null ) {
      Severity: Minor
      Found in includes/libs/filebackend/SwiftFileBackend.php - About 1 hr to fix

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

            protected function doDescribeInternal( array $params ) {
                $status = $this->newStatus();
        
                [ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $params['src'] );
                if ( $srcRel === null ) {
        Severity: Minor
        Found in includes/libs/filebackend/SwiftFileBackend.php - About 1 hr to fix

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

              protected function doStoreInternal( array $params ) {
                  $status = $this->newStatus();
          
                  $fsSrcPath = $params['src']; // file system path
                  $fsDstPath = $this->resolveToFSPath( $params['dst'] );
          Severity: Minor
          Found in includes/libs/filebackend/FSFileBackend.php - About 1 hr to fix

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

                public function __construct( array $config ) {
                    if ( !array_key_exists( 'name', $config ) ) {
                        throw new InvalidArgumentException( 'Backend name not specified.' );
                    }
                    $this->name = $config['name'];
            Severity: Minor
            Found in includes/libs/filebackend/FileBackend.php - About 1 hr to fix

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

                  final public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
                      if (
                          $flush !== self::FLUSHING_INTERNAL &&
                          $flush !== self::FLUSHING_ALL_PEERS &&
                          $this->flagsHolder->hasImplicitTrxFlag()
              Severity: Minor
              Found in includes/libs/rdbms/database/Database.php - About 1 hr to fix

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

                    private function parseDTD( $dtd ) {
                        $m = [];
                        $res = preg_match(
                            '/^<!DOCTYPE\s*\S+\s*' .
                            '(?:(?P<typepublic>PUBLIC)\s*' .
                Severity: Minor
                Found in includes/libs/mime/XmlTypeCheck.php - About 1 hr to fix

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

                      protected function getFooter( $iconStyle = 'icononly', $linkStyle = 'flat' ) {
                          $validFooterIcons = $this->get( 'footericons' );
                          if ( $iconStyle === 'icononly' ) {
                              $this->unsetIconsWithoutImages( $validFooterIcons );
                          } else {
                  Severity: Minor
                  Found in includes/skins/BaseTemplate.php - About 1 hr to fix

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

                        public function validate( $value, $alldata ) {
                            // If the value is null, reset it to an empty string which is what is expected by the parent.
                            $value ??= '';
                    
                            // If the value is empty, there are no additional checks that can be performed.
                    Severity: Minor
                    Found in includes/htmlform/fields/HTMLUserTextField.php - About 1 hr to fix

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

                          public function getRawText() {
                              $text = false;
                              $title = $this->getTitle();
                              $request = $this->getRequest();
                      
                      
                      Severity: Minor
                      Found in includes/actions/RawAction.php - About 1 hr to fix

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

                            public function formatDurationBetweenTimestamps(
                                int $timestamp1,
                                int $timestamp2,
                                ?int $precision = null
                            ): string {
                        Severity: Minor
                        Found in includes/language/Language.php - About 1 hr to fix

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

                              protected function renderingPreferences(
                                  User $user,
                                  MessageLocalizer $l10n,
                                  &$defaultPreferences
                              ) {
                          Severity: Minor
                          Found in includes/preferences/DefaultPreferencesFactory.php - About 1 hr to fix

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

                                public function normalizePageName( string $pageName, $apiUrl, $followRedirect = self::FOLLOW_REDIRECT ) {
                                    if ( $followRedirect === self::FOLLOW_REDIRECT ) {
                                        $redirects = true;
                                    } elseif ( $followRedirect === self::NOFOLLOW_REDIRECT ) {
                                        $redirects = false;
                            Severity: Minor
                            Found in includes/site/MediaWikiPageNameNormalizer.php - About 1 hr to fix

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

                                  protected function getPageHtml( $formHtml ) {
                                      $loginPrompt = $this->isSignup() ? '' : Html::rawElement( 'div',
                                          [ 'id' => 'userloginprompt' ], $this->msg( 'loginprompt' )->parseAsBlock() );
                                      $languageLinks = $this->getConfig()->get( MainConfigNames::LoginLanguageSelector )
                                          ? $this->makeLanguageSelector() : '';
                              Severity: Minor
                              Found in includes/specialpage/LoginSignupSpecialPage.php - About 1 hr to fix

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

                                    public function submit() {
                                        $status = $this->submitWebUserBox();
                                        if ( !$status->isOK() ) {
                                            return $status;
                                        }
                                Severity: Minor
                                Found in includes/installer/PostgresSettingsForm.php - About 1 hr to fix

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

                                      public function partition( $table, $batchSize ) {
                                          if ( isset( $this->partitionCache[$table][$batchSize] ) ) {
                                              $this->logger->debug( __METHOD__ . ": got from partition cache" );
                                  
                                              return $this->partitionCache[$table][$batchSize]['batches'];
                                  Severity: Minor
                                  Found in includes/cache/BacklinkCache.php - About 1 hr to fix

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

                                        public function preUpgrade() {
                                            global $wgDBuser, $wgDBpassword;
                                    
                                            $status = $this->getConnection( self::CONN_CREATE_TABLES );
                                            if ( !$status->isOK() ) {
                                    Severity: Minor
                                    Found in includes/installer/MysqlInstaller.php - About 1 hr to fix

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

                                          public function getAllowedParams() {
                                              return [
                                                  'from' => null,
                                                  'to' => null,
                                                  'prefix' => null,
                                      Severity: Minor
                                      Found in includes/api/ApiQueryFilearchive.php - About 1 hr to fix

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

                                            private static function validateValue( $value ) {
                                                if ( is_object( $value ) ) {
                                                    // Note we use is_callable() here instead of instanceof because
                                                    // ApiSerializable is an informal protocol (see docs there for details).
                                                    if ( is_callable( [ $value, 'serializeForApiResult' ] ) ) {
                                        Severity: Minor
                                        Found in includes/api/ApiResult.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language