wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method loadFiles has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function loadFiles(): void {
        # Allow media handling extensions adding MIME-types and MIME-info
        if ( $this->initCallback ) {
            call_user_func( $this->initCallback, $this );
        }
Severity: Minor
Found in includes/libs/mime/MimeAnalyzer.php - About 1 hr to fix

    Method detectMimeType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function detectMimeType( string $file, $ext = true ): string {
            /** @todo Make $ext default to false. Or better, remove it. */
            if ( $ext ) {
                $this->logger->info( __METHOD__ .
                    ": WARNING: use of the \$ext parameter is deprecated. "
    Severity: Minor
    Found in includes/libs/mime/MimeAnalyzer.php - About 1 hr to fix

      Method replaceLostConnection has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function replaceLostConnection( $lastErrno, $fname ) {
              if ( $this->conn ) {
                  $this->closeConnection();
                  $this->conn = null;
                  $this->handleSessionLossPreconnect();
      Severity: Minor
      Found in includes/libs/rdbms/database/Database.php - About 1 hr to fix

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

            public function reallyDoQuery( $offset, $limit, $order ) {
                [ $tables, $fields, $conds, $fname, $options, $join_conds ] = $this->buildQueryInfo(
                    $offset,
                    $limit,
                    $order
        Severity: Minor
        Found in includes/pager/ContributionsPager.php - About 1 hr to fix

          Method getInputHTML has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getInputHTML( $value ) {
                  $valInSelect = false;
          
                  if ( $value !== false ) {
                      $value = strval( $value );
          Severity: Minor
          Found in includes/htmlform/fields/HTMLSelectOrOtherField.php - About 1 hr to fix

            Method getTableRow has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getTableRow( $value ) {
                    [ $errors, $errorClass ] = $this->getErrorsAndErrorClass( $value );
                    $inputHtml = $this->getInputHTML( $value );
                    $fieldType = $this->getClassName();
                    $helptext = $this->getHelpTextHtmlTable( $this->getHelpText() );
            Severity: Minor
            Found in includes/htmlform/HTMLFormField.php - About 1 hr to fix

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

                  public function __construct( $repoDir, $usePrecomputed = true ) {
                      $this->repoDir = $repoDir;
                      $services = MediaWikiServices::getInstance();
                      $this->options = new ServiceOptions(
                          self::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
              Severity: Minor
              Found in includes/utils/GitInfo.php - About 1 hr to fix

                Method read has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function read() {
                        $keepReading = $this->reader->read();
                
                        /* Skip until first element */
                        while ( $keepReading && $this->reader->nodeType !== XMLReader::ELEMENT ) {
                Severity: Minor
                Found in includes/media/SVGReader.php - About 1 hr to fix

                  Method handleReauthBeforeExecute has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function handleReauthBeforeExecute( $subPage ) {
                          $authManager = $this->getAuthManager();
                          $request = $this->getRequest();
                          $key = 'AuthManagerSpecialPage:reauth:' . $this->getName();
                  
                  
                  Severity: Minor
                  Found in includes/specialpage/AuthManagerSpecialPage.php - About 1 hr to fix

                    Method format has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function format( string $format ): string {
                            $string = $this->fetchMessage();
                    
                            if ( $string === false ) {
                                // Err on the side of safety, ensure that the output
                    Severity: Minor
                    Found in includes/Message/Message.php - About 1 hr to fix

                      Method loadExtensions has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function loadExtensions() {
                              if ( $this->autoExtensionHookContainer ) {
                                  // Already injected by installer
                                  return $this->autoExtensionHookContainer;
                              }
                      Severity: Minor
                      Found in includes/installer/DatabaseUpdater.php - About 1 hr to fix

                        Method getCacheKey has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getCacheKey( $page, $passThrough = false ) {
                                if ( is_string( $page ) ) {
                                    if ( $passThrough ) {
                                        return $page;
                                    } else {
                        Severity: Minor
                        Found in includes/cache/LinkCache.php - About 1 hr to fix

                          Method getLocalSettings has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getLocalSettings() {
                                  $dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
                                  // These tables have frequent writes and are thus split off from the main one.
                                  // Since the code using these tables only uses transactions for writes, then set
                                  // them to using BEGIN IMMEDIATE. This avoids frequent lock errors on the first write action.
                          Severity: Minor
                          Found in includes/installer/SqliteInstaller.php - About 1 hr to fix

                            Method getContinuation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getContinuation() {
                                    $data = [];
                                    $batchcomplete = false;
                            
                                    $finishedModules = array_diff(
                            Severity: Minor
                            Found in includes/api/ApiContinuationManager.php - About 1 hr to fix

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

                                  public function execute() {
                                      $params = $this->extractRequestParams();
                              
                                      $opt = 0;
                                      if ( $this->isRaw ) {
                              Severity: Minor
                              Found in includes/api/ApiFormatJson.php - About 1 hr to fix

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

                                    public function execute() {
                                        $params = $this->extractRequestParams();
                                
                                        $this->requireAtLeastOneParameter( $params, 'continue', 'returnurl' );
                                
                                
                                Severity: Minor
                                Found in includes/api/ApiClientLogin.php - About 1 hr to fix

                                  Method createFeedItem has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function createFeedItem( $info ) {
                                          if ( !isset( $info['title'] ) ) {
                                              // Probably a revdeled log entry, skip it.
                                              return null;
                                          }
                                  Severity: Minor
                                  Found in includes/api/ApiFeedWatchlist.php - About 1 hr to fix

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

                                        public function run( $resultPageSet = null ) {
                                            $params = $this->extractRequestParams();
                                    
                                            // Since 'filterredir" will always be set in $params, we have to dig
                                            // into the WebRequest to see if it was actually passed.
                                    Severity: Minor
                                    Found in includes/api/ApiQueryRandom.php - About 1 hr to fix

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

                                          public function execute( $par ) {
                                              $this->useTransactionalTimeLimit();
                                      
                                              $this->checkPermissions();
                                              $this->checkReadOnly();
                                      Severity: Minor
                                      Found in includes/specials/SpecialMergeHistory.php - About 1 hr to fix

                                        Method processAsyncUpload has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function processAsyncUpload() {
                                                // Ensure the upload we're dealing with is an UploadFromUrl
                                                if ( !$this->mUpload instanceof \UploadFromUrl ) {
                                                    $this->showUploadError( $this->msg( 'uploaderror' )->escaped() );
                                        
                                        
                                        Severity: Minor
                                        Found in includes/specials/SpecialUpload.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language