wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method appendUserGroups has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function appendUserGroups( $property, $numberInGroup ) {
        $config = $this->getConfig();

        $data = [];
        $result = $this->getResult();
Severity: Minor
Found in includes/api/ApiQuerySiteinfo.php - About 1 hr to fix

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

        public function execute( $subpage ) {
            $user = $this->getUser();
            if (
                // Anons don't get a watchlist
                !$user->isRegistered()
    Severity: Minor
    Found in includes/specials/SpecialWatchlist.php - About 1 hr to fix

      Method formatPolicies has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function formatPolicies( $policies, $group ) {
              $groupPolicies = UserPasswordPolicy::getPoliciesForGroups(
                  $policies['policies'],
                  [ $group ],
                  $policies['policies']['default']
      Severity: Minor
      Found in includes/specials/SpecialPasswordPolicies.php - About 1 hr to fix

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

            public function execute( $par ) {
                if ( !$par ) {
                    $par = 'main';
                }
        
        
        Severity: Minor
        Found in includes/specials/SpecialApiHelp.php - About 1 hr to fix

          Method showList has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function showList( $result ) {
                  $out = $this->getOutput();
          
                  if ( $result->numRows() == 0 ) {
                      $out->addWikiMsg( 'undelete-no-results' );
          Severity: Minor
          Found in includes/specials/SpecialUndelete.php - About 1 hr to fix

            Method formatValue has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function formatValue( $field, $value ) {
                    $linkRenderer = $this->getLinkRenderer();
                    switch ( $field ) {
                        case 'am_title':
                            $title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
            Severity: Minor
            Found in includes/specials/pagers/AllMessagesTablePager.php - About 1 hr to fix

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

                  public function __construct( ?string $permission, $status = [] ) {
                      $this->deprecatePublicProperty( 'permission', '1.43' );
                      $this->deprecatePublicPropertyFallback( 'errors', '1.43',
                          function () {
                              return $this->status->toLegacyErrorArray();
              Severity: Minor
              Found in includes/exception/PermissionsError.php - About 1 hr to fix

                Method userToolLinkArray has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function userToolLinkArray(
                        $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null
                    ): array {
                        $services = MediaWikiServices::getInstance();
                        $disableAnonTalk = $services->getMainConfig()->get( MainConfigNames::DisableAnonTalk );
                Severity: Minor
                Found in includes/linker/Linker.php - About 1 hr to fix

                  Method save has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function save(
                          ParserOutput $output,
                          RevisionRecord $revision,
                          ParserOptions $parserOptions,
                          string $cacheTime = null
                  Severity: Minor
                  Found in includes/parser/RevisionOutputCache.php - About 1 hr to fix

                    Method getCachedRevisionObject has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static function getCachedRevisionObject( $parser, $title, $vary ) {
                            if ( !$title ) {
                                return null;
                            }
                    
                    
                    Severity: Minor
                    Found in includes/parser/CoreParserFunctions.php - About 1 hr to fix

                      Method getQueryInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getQueryInfo() {
                              $queryBuilder = DatabaseLogEntry::newSelectQueryBuilder( $this->mDb )
                                  ->where( $this->mConds );
                      
                              # Add log_search table if there are conditions on it.
                      Severity: Minor
                      Found in includes/logging/LogPager.php - About 1 hr to fix

                        Method getFile has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getFile( $key, $noAuth = false ) {
                                if ( !preg_match( self::KEY_FORMAT_REGEX, $key ) ) {
                                    throw new UploadStashBadPathException(
                                        wfMessage( 'uploadstash-bad-path-bad-format', $key )
                                    );
                        Severity: Minor
                        Found in includes/upload/UploadStash.php - About 1 hr to fix

                          Method removeUserFromGroup has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function removeUserFromGroup( UserIdentity $user, string $group ): bool {
                                  $user->assertWiki( $this->wikiId );
                                  // TODO: Deprecate passing out user object in the hook by introducing
                                  // an alternative hook
                                  if ( $this->hookContainer->isRegistered( 'UserRemoveGroup' ) ) {
                          Severity: Minor
                          Found in includes/user/UserGroupManager.php - About 1 hr to fix

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

                                public function run( $title, $type ) {
                                    $normalizedType = $this->normalizeType( $type );
                                    $this->validateParameterCombination( $normalizedType );
                                    $params = $this->getValidatedParams();
                                    $page = $this->getPage();
                            Severity: Minor
                            Found in includes/Rest/Handler/PageHistoryCountHandler.php - About 1 hr to fix

                              Method getConflictData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function getConflictData() {
                                      $body = $this->getValidatedBody();
                                      '@phan-var array $body';
                                      $baseRevId = $body['latest']['id'] ?? 0;
                                      $title = $this->titleParser->parseTitle( $this->getValidatedParams()['title'] );
                              Severity: Minor
                              Found in includes/Rest/Handler/UpdateHandler.php - About 1 hr to fix

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

                                    private static function run( DeferrableUpdate $update ): ?Throwable {
                                        $logger = LoggerFactory::getInstance( 'DeferredUpdates' );
                                
                                        $type = get_class( $update )
                                            . ( $update instanceof DeferrableCallback ? '_' . $update->getOrigin() : '' );
                                Severity: Minor
                                Found in includes/deferred/DeferredUpdates.php - About 1 hr to fix

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

                                      public function __construct( array $config = [] ) {
                                          // Configuration initialization
                                          $config = array_merge(
                                              [
                                                  // Config options for nested widgets
                                  Severity: Minor
                                  Found in includes/widget/ComplexNamespaceInputWidget.php - About 1 hr to fix

                                    Method purgeExpiredRows has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function purgeExpiredRows() {
                                            $services = MediaWikiServices::getInstance();
                                            $rcMaxAge = $services->getMainConfig()->get(
                                                MainConfigNames::RCMaxAge );
                                            $updateRowsPerQuery = $services->getMainConfig()->get(
                                    Severity: Minor
                                    Found in includes/recentchanges/RecentChangesUpdateJob.php - About 1 hr to fix

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

                                          public function execute() {
                                              // Extract the host and scheme from $wgServer
                                              $server = $this->getConfig()->get( MainConfigNames::Server );
                                              $bits = $this->getServiceContainer()->getUrlUtils()->parse( $server );
                                              if ( !$bits ) {
                                      Severity: Minor
                                      Found in maintenance/deleteSelfExternals.php - About 1 hr to fix

                                        Method deleteDefaults has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function deleteDefaults() {
                                                $dryRun = $this->hasOption( 'dry' );
                                                $option = $this->getArg( 0 );
                                                $fromUserId = (int)$this->getOption( 'fromuserid', 0 );
                                                $toUserId = (int)$this->getOption( 'touserid', 0 ) ?: null;
                                        Severity: Minor
                                        Found in maintenance/userOptions.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language