wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method getMessageForLang has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getMessageForLang( $lang, $lckey, $useDB, &$alreadyTried ) {
        $langcode = $lang->getCode();

        // Try checking the database for the requested language
        if ( $useDB ) {
Severity: Minor
Found in includes/language/MessageCache.php - About 2 hrs to fix

    Method normaliseParams has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function normaliseParams( $image, &$params ) {
            if ( !isset( $params['width'] ) ) {
                return false;
            }
    
    
    Severity: Minor
    Found in includes/media/ImageHandler.php - About 2 hrs to fix

      Method convertDumpToJSON has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function convertDumpToJSON( $dump ) {
              if ( strval( $dump ) == '' ) {
                  return false;
              }
      
      
      Severity: Minor
      Found in includes/media/DjVuImage.php - About 2 hrs to fix

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

            protected function getForm() {
                $context = $this->getContext();
                $onSubmit = [ $this, 'onSubmit' ];
        
                if ( $this->reauthPostData ) {
        Severity: Minor
        Found in includes/specialpage/FormSpecialPage.php - About 2 hrs to fix

          Method performStash has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function performStash( $failureMode, &$data = null ) {
                  $isPartial = (bool)$this->mParams['chunk'];
                  try {
                      $status = $this->mUpload->tryStashFile( $this->getUser(), $isPartial );
          
          
          Severity: Minor
          Found in includes/api/ApiUpload.php - About 2 hrs to fix

            Method populateResult has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function populateResult( $search, &$results ) {
                    $result = $this->getResult();
            
                    switch ( $this->getFormat() ) {
                        case 'json':
            Severity: Minor
            Found in includes/api/ApiOpenSearch.php - About 2 hrs to fix

              Method getVisitingWatcherInfo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getVisitingWatcherInfo() {
                      $config = $this->getConfig();
                      $db = $this->getDB();
              
                      $canUnwatchedpages = $this->getAuthority()->isAllowed( 'unwatchedpages' );
              Severity: Minor
              Found in includes/api/ApiQueryInfo.php - About 2 hrs to fix

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

                    public function getAllowedParams() {
                        return [
                            'action' => [
                                ParamValidator::PARAM_DEFAULT => 'help',
                                ParamValidator::PARAM_TYPE => 'submodule',
                Severity: Minor
                Found in includes/api/ApiMain.php - About 2 hrs to fix

                  Method formatPermissions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
                          $r = [];
                          foreach ( $permissions as $permission ) {
                              // show as granted only if it isn't revoked to prevent duplicate display of permissions
                              if ( !isset( $revoke[$permission] ) || !$revoke[$permission] ) {
                  Severity: Minor
                  Found in includes/specials/SpecialListGroupRights.php - About 2 hrs to fix

                    Method listItem has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function listItem( stdClass $row, PageIdentity $nt, LinkTarget $target, bool $notClose = false ) {
                            $legacyTitle = $this->titleFactory->newFromPageIdentity( $nt );
                            $dirmark = $this->getLanguage()->getDirMark();
                    
                            if ( $row->rd_from ) {
                    Severity: Minor
                    Found in includes/specials/SpecialWhatLinksHere.php - About 2 hrs to fix

                      Method buildCheckBoxes has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function buildCheckBoxes() {
                              // If there is just one item, provide the user with a multi-select field
                              $list = $this->getList();
                              $tags = [];
                              if ( $list->length() == 1 ) {
                      Severity: Minor
                      Found in includes/specials/SpecialEditTags.php - About 2 hrs to fix

                        Method headElement has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function headElement( Skin $sk, $includeStyle = true ) {
                                $config = $this->getConfig();
                                $userdir = $this->getLanguage()->getDir();
                                $services = MediaWikiServices::getInstance();
                                $sitedir = $services->getContentLanguage()->getDir();
                        Severity: Minor
                        Found in includes/Output/OutputPage.php - About 2 hrs to fix

                          Method hitThumbUrl has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function hitThumbUrl( LocalFile $file, $transformParams ) {
                                  $config = MediaWikiServices::getInstance()->getMainConfig();
                                  $uploadThumbnailRenderHttpCustomHost =
                                      $config->get( MainConfigNames::UploadThumbnailRenderHttpCustomHost );
                                  $uploadThumbnailRenderHttpCustomDomain =
                          Severity: Minor
                          Found in includes/jobqueue/jobs/ThumbnailRenderJob.php - About 2 hrs to fix

                            Method doBatchPushInternal has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function doBatchPushInternal( IDatabase $dbw, array $jobs, $flags, $method ) {
                                    if ( $jobs === [] ) {
                                        return;
                                    }
                            
                            
                            Severity: Minor
                            Found in includes/jobqueue/JobQueueDB.php - About 2 hrs to fix

                              Method extractTagsAndParams has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function extractTagsAndParams( array $elements, $text, &$matches ) {
                                      static $n = 1;
                                      $stripped = '';
                                      $matches = [];
                              
                              
                              Severity: Minor
                              Found in includes/parser/Parser.php - About 2 hrs to fix

                                Method makeLimitReport has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function makeLimitReport() {
                                        $maxIncludeSize = $this->mOptions->getMaxIncludeSize();
                                
                                        $cpuTime = $this->mOutput->getTimeProfile( 'cpu' );
                                        if ( $cpuTime !== null ) {
                                Severity: Minor
                                Found in includes/parser/Parser.php - About 2 hrs to fix

                                  Method __construct has 16 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function __construct( $list, $types = [], $performer = '', $page = '',
                                          $pattern = false, $conds = [], $year = false, $month = false, $day = false,
                                          $tagFilter = '', $action = '', $logId = 0,
                                          LinkBatchFactory $linkBatchFactory = null,
                                          ActorNormalization $actorNormalization = null,
                                  Severity: Major
                                  Found in includes/logging/LogPager.php - About 2 hrs to fix

                                    Method thumbError has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected function thumbError( $status, $msgHtml, $msgText = null, $context = [] ) {
                                            $showHostnames = $this->getConfig( MainConfigNames::ShowHostnames );
                                    
                                            HeaderCallback::warnIfHeadersSent();
                                    
                                    
                                    Severity: Minor
                                    Found in includes/filerepo/ThumbnailEntryPoint.php - About 2 hrs to fix

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

                                          public function execute(): Response {
                                              $ctype = $this->getContentType();
                                      
                                              $response = $this->getResponseFactory()->create();
                                              $response->setHeader( 'Content-type', $ctype );
                                      Severity: Minor
                                      Found in includes/Rest/Handler/OpenSearchDescriptionHandler.php - About 2 hrs to fix

                                        Method fetchParserOutputFromParsoid has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function fetchParserOutputFromParsoid( PageIdentity $page, $revision, bool $mayParse ): ?ParserOutput {
                                                $parserOptions = ParserOptions::newFromAnon();
                                                $parserOptions->setUseParsoid();
                                        
                                                try {
                                        Severity: Minor
                                        Found in includes/Rest/Handler/Helper/HtmlInputTransformHelper.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language