wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method saveFormData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function saveFormData( $formData, PreferencesFormOOUI $form, array $formDescriptor ) {
        $user = $form->getModifiedUser();
        $hiddenPrefs = $this->options->get( MainConfigNames::HiddenPrefs );
        $result = true;

Severity: Minor
Found in includes/preferences/DefaultPreferencesFactory.php - About 1 hr to fix

    Method charCodeString has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function charCodeString( $prop ) {
            if ( isset( $this->mFilteredExifData[$prop] ) ) {
                if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) {
                    // invalid. Must be at least 9 bytes long.
    
    
    Severity: Minor
    Found in includes/media/Exif.php - About 1 hr to fix

      Method timeHelper has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function timeHelper( $date, $time, $charset ) {
              if ( count( $date ) === 1 ) {
                  // the standard says this should always be 1
                  // just double checking.
                  [ $date ] = self::convIPTC( $date, $charset );
      Severity: Minor
      Found in includes/media/IPTC.php - About 1 hr to fix

        Method considerActionsForDefaultSavedQuery has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function considerActionsForDefaultSavedQuery( $subpage ) {
                if ( !$this->isStructuredFilterUiEnabled() || $this->including() ) {
                    return false;
                }
        
        
        Severity: Minor
        Found in includes/specialpage/ChangesListSpecialPage.php - About 1 hr to fix

          Method performAuthenticationStep has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function performAuthenticationStep( $action, array $requests ) {
                  if ( !in_array( $action, static::$allowedActions, true ) ) {
                      throw new InvalidArgumentException( 'invalid action: ' . $action );
                  }
          
          
          Severity: Minor
          Found in includes/specialpage/AuthManagerSpecialPage.php - About 1 hr to fix

            Method runUpdates has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function runUpdates( array $updates, $passSelf, $hasVirtualDomain = false ) {
                    $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
                    $updatesDone = [];
                    $updatesSkipped = [];
                    foreach ( $updates as $params ) {
            Severity: Minor
            Found in includes/installer/DatabaseUpdater.php - About 1 hr to fix

              Method getPages has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getPages() {
                      static $qp = null;
              
                      if ( $qp === null ) {
                          $qp = [
              Severity: Minor
              Found in includes/specialpage/QueryPage.php - About 1 hr to fix

                Method getRestrictionData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getRestrictionData( IResultWrapper $result, $limit ) {
                        $partialIds = [];
                        $count = 0;
                        foreach ( $result as $row ) {
                            if ( ++$count <= $limit && !( $row->ipb_sitewide ?? $row->bl_sitewide ) ) {
                Severity: Minor
                Found in includes/api/ApiQueryBlocks.php - About 1 hr to fix

                  Method extractSlotInfo has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function extractSlotInfo( SlotRecord $slot, $revDel, &$content = null ) {
                          $vals = [];
                          ApiResult::setArrayType( $vals, 'assoc' );
                  
                          if ( $this->fld_slotsize ) {
                  Severity: Minor
                  Found in includes/api/ApiQueryRevisionsBase.php - About 1 hr to fix

                    Method getInvalidTitlesAndRevisions has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getInvalidTitlesAndRevisions( $invalidChecks = [ 'invalidTitles',
                            'special', 'missingIds', 'missingRevIds', 'missingTitles', 'interwikiTitles' ]
                        ) {
                            $result = [];
                            if ( in_array( 'invalidTitles', $invalidChecks ) ) {
                    Severity: Minor
                    Found in includes/api/ApiPageSet.php - About 1 hr to fix

                      Method getStandardParams has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getStandardParams( $action, ...$wantedParams ) {
                              $params = [
                                  'requests' => [
                                      ParamValidator::PARAM_TYPE => 'string',
                                      ParamValidator::PARAM_ISMULTI => true,
                      Severity: Minor
                      Found in includes/api/ApiAuthManagerHelper.php - About 1 hr to fix

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

                            public function getAllowedParams() {
                                $allowedParams = [
                                    'continue' => [
                                        ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
                                    ],
                        Severity: Minor
                        Found in includes/api/ApiQueryAllLinks.php - About 1 hr to fix

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

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

                            Method formatHelpMessages has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function formatHelpMessages( array &$res, $key, array $msgs, $joinLists = false ) {
                                    switch ( $this->helpFormat ) {
                                        case 'none':
                                            break;
                            
                            
                            Severity: Minor
                            Found in includes/api/ApiParamInfo.php - About 1 hr to fix

                              Method execute has 40 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/ApiAMCreateAccount.php - About 1 hr to fix

                                Method showMergeForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function showMergeForm() {
                                        $out = $this->getOutput();
                                        $out->addWikiMsg( 'mergehistory-header' );
                                
                                        $fields = [
                                Severity: Minor
                                Found in includes/specials/SpecialMergeHistory.php - About 1 hr to fix

                                  Method showActivateDeactivateForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function showActivateDeactivateForm( $tag, $activate ) {
                                          $actionStr = $activate ? 'activate' : 'deactivate';
                                  
                                          $authority = $this->getAuthority();
                                          if ( !$authority->isAllowed( 'managechangetags' ) ) {
                                  Severity: Minor
                                  Found in includes/specials/SpecialTags.php - About 1 hr to fix

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

                                        public function reallyDoQuery( $offset, $limit, $order ) {
                                            $dbr = $this->getDatabase();
                                            $prevTableName = $this->mTableName;
                                            $this->mTableName = 'image';
                                            [ $tables, $fields, $conds, $fname, $options, $join_conds ] =
                                    Severity: Minor
                                    Found in includes/specials/pagers/ImageListPager.php - About 1 hr to fix

                                      Method getForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getForm() {
                                              $formDescriptor = [];
                                              $formDescriptor['limit'] = [
                                                  'type' => 'radio',
                                                  'name' => 'limit',
                                      Severity: Minor
                                      Found in includes/specials/pagers/ImageListPager.php - About 1 hr to fix

                                        Method outputRemoteScaledThumb has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function outputRemoteScaledThumb( $file, $params ) {
                                                // We need to use generateThumbName() instead of thumbName(), because
                                                // the suffix needs to match the file name for the remote thumbnailer
                                                // to work
                                                $scalerThumbName = $file->generateThumbName( $file->getName(), $params );
                                        Severity: Minor
                                        Found in includes/specials/SpecialUploadStash.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language