wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method mysqlConnect has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function mysqlConnect( $server, $user, $password, $db ) {
        if ( !function_exists( 'mysqli_init' ) ) {
            throw $this->newExceptionAfterConnectError(
                "MySQLi functions missing, have you compiled PHP with the --with-mysqli option?"
            );
Severity: Minor
Found in includes/libs/rdbms/database/DatabaseMySQL.php - About 1 hr to fix

    Method newFromRow has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function newFromRow( IReadableDatabase $db, $row ) {
            if ( isset( $row->ipb_id ) ) {
                return new DatabaseBlock( [
                    'address' => $row->ipb_address,
                    'wiki' => $this->wikiId,
    Severity: Minor
    Found in includes/block/DatabaseBlockStore.php - About 1 hr to fix

      Method runPrimaryTransactionIdleCallbacks has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function runPrimaryTransactionIdleCallbacks( $fname = __METHOD__ ) {
              if ( $this->trxRoundStage === self::ROUND_COMMIT_CALLBACKS ) {
                  $type = IDatabase::TRIGGER_COMMIT;
              } elseif ( $this->trxRoundStage === self::ROUND_ROLLBACK_CALLBACKS ) {
                  $type = IDatabase::TRIGGER_ROLLBACK;
      Severity: Minor
      Found in includes/libs/rdbms/loadbalancer/LoadBalancer.php - About 1 hr to fix

        Method getPortletsTemplateData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getPortletsTemplateData() {
                if ( $this->portletsCached ) {
                    return $this->portletsCached;
                }
                $portlets = [];
        Severity: Minor
        Found in includes/skins/SkinTemplate.php - About 1 hr to fix

          Method getCodex has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getCodex( $value ) {
                  $isDisabled = ( $this->mParams['disabled'] ?? false );
          
                  // Label
                  $labelDiv = '';
          Severity: Minor
          Found in includes/htmlform/HTMLFormField.php - About 1 hr to fix

            Method getTemplate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function getTemplate( $templateName ) {
                    $templateKey = $templateName . '|' . $this->compileFlags;
            
                    // If a renderer has already been defined for this template, reuse it
                    if ( isset( $this->renderers[$templateKey] ) &&
            Severity: Minor
            Found in includes/Html/TemplateParser.php - About 1 hr to fix

              Method recursiveConvertRule has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) {
                      // Quick check (no function calls)
                      if ( $text[$startPos] !== '-' || $text[$startPos + 1] !== '{' ) {
                          throw new InvalidArgumentException( __METHOD__ . ': invalid input string' );
                      }
              Severity: Minor
              Found in includes/language/LanguageConverter.php - About 1 hr to fix

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

                    public function execute() {
                        $params = $this->extractRequestParams();
                        $alltitles = $this->getPageSet()->getGoodAndMissingTitlesByNamespace();
                        if ( empty( $alltitles[NS_CATEGORY] ) ) {
                            return;
                Severity: Minor
                Found in includes/api/ApiQueryCategoryInfo.php - About 1 hr to fix

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

                      public function getAllowedParams( $flags = 0 ) {
                          $allGroups = $this->userGroupManager->listAllGroups();
                  
                          if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) {
                              sort( $allGroups );
                  Severity: Minor
                  Found in includes/api/ApiUserrights.php - About 1 hr to fix

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

                        public function execute( $par ) {
                            $this->setHeaders();
                            $this->outputHeader();
                    
                            $out = $this->getOutput();
                    Severity: Minor
                    Found in includes/specials/SpecialListGrants.php - About 1 hr to fix

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

                          protected function getFormFields() {
                              // Get default from the subpage of Special page
                              $defaultName = $this->par;
                              $title = $defaultName ? Title::newFromText( $defaultName ) : null;
                              if ( $title ) {
                      Severity: Minor
                      Found in includes/specials/SpecialPageLanguage.php - About 1 hr to fix

                        Method undelete has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function undelete() {
                                if ( $this->getConfig()->get( MainConfigNames::UploadMaintenance )
                                    && $this->mTargetObj->getNamespace() === NS_FILE
                                ) {
                                    throw new ErrorPageError( 'undelete-error', 'filedelete-maintenance' );
                        Severity: Minor
                        Found in includes/specials/SpecialUndelete.php - About 1 hr to fix

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

                              public function execute( $par ) {
                                  $this->setHeaders();
                                  $this->outputHeader();
                                  $this->addHelpLink( 'Help:Managing_files' );
                          
                          
                          Severity: Minor
                          Found in includes/specials/SpecialListFiles.php - About 1 hr to fix

                            Method getQueryInfoReal has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getQueryInfoReal( $table ) {
                                    $dbr = $this->getDatabase();
                                    $prefix = $table === 'oldimage' ? 'oi' : 'img';
                            
                                    $tables = [ $table, 'actor' ];
                            Severity: Minor
                            Found in includes/specials/pagers/ImageListPager.php - About 1 hr to fix

                              Method tryJobInsertions has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function tryJobInsertions( array $jobs, HashRing &$partitionRing, $flags ) {
                                      $jobsLeft = [];
                              
                                      // Because jobs are spread across partitions, per-job de-duplication needs
                                      // to use a consistent hash to avoid allowing duplicate jobs per partition.
                              Severity: Minor
                              Found in includes/jobqueue/JobQueueFederated.php - About 1 hr to fix

                                Method getUserSig has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getUserSig( UserIdentity $user, $nickname = false, $fancySig = null ) {
                                        $username = $user->getName();
                                
                                        # If not given, retrieve from the user object.
                                        if ( $nickname === false ) {
                                Severity: Minor
                                Found in includes/parser/Parser.php - About 1 hr to fix

                                  Method interwikiTransclude has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function interwikiTransclude( LinkTarget $link, $action ) {
                                          if ( !$this->svcOptions->get( MainConfigNames::EnableScaryTranscluding ) ) {
                                              return wfMessage( 'scarytranscludedisabled' )->inContentLanguage()->text();
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in includes/parser/Parser.php - About 1 hr to fix

                                    Method store has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function store( UserIdentity $user, array $updates ) {
                                            // In core, only users with local accounts may have preferences
                                            if ( !$user->getId() ) {
                                                return false;
                                            }
                                    Severity: Minor
                                    Found in includes/user/Options/LocalUserOptionsStore.php - About 1 hr to fix

                                      Method getWhere has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getWhere( IReadableDatabase $db, $key, $users, $useId = true ) {
                                              $this->checkDeprecation( $key );
                                      
                                              $tables = [];
                                              $conds = [];
                                      Severity: Minor
                                      Found in includes/user/ActorMigrationBase.php - About 1 hr to fix

                                        Method parseBodyData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function parseBodyData( RequestInterface $request ): ?array {
                                                // Parse the body based on its content type
                                                $contentType = $request->getBodyType();
                                        
                                                // HACK: If the Handler uses a custom BodyValidator, the
                                        Severity: Minor
                                        Found in includes/Rest/Handler.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language