wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function domManip has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function domManip( collection, args, callback, ignored ) {

    // Flatten any nested arrays
    args = flat( args );

Severity: Major
Found in resources/lib/jquery/jquery.js - About 2 hrs to fix

    Function OoUiMenuTagMultiselectWidget has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    OO.ui.MenuTagMultiselectWidget = function OoUiMenuTagMultiselectWidget( config ) {
        let $autoCloseIgnore = $( [] );
    
        config = config || {};
    
    
    Severity: Major
    Found in resources/lib/ooui/oojs-ui-widgets.js - About 2 hrs to fix

      Function setActive has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      OO.ui.PopupToolGroup.prototype.setActive = function ( value ) {
          let containerWidth, containerLeft;
          value = !!value;
          if ( this.active !== value ) {
              this.active = value;
      Severity: Major
      Found in resources/lib/ooui/oojs-ui-toolbars.js - About 2 hrs to fix

        Function deflate_fast has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const deflate_fast = (s, flush) => {
        
            let hash_head;        /* head of the hash chain */
            let bflush;           /* set if current block must be flushed */
        
        
        Severity: Major
        Found in resources/lib/pako/pako_deflate.js - About 2 hrs to fix

          Method getFeatureFilePaths has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getFeatureFilePaths() {
                  // Bypass the current module paths so that these files are served from core,
                  // instead of the individual skin's module directory.
                  [ $defaultLocalBasePath, $defaultRemoteBasePath ] =
                      FileModule::extractBasePaths(
          Severity: Major
          Found in includes/ResourceLoader/SkinModule.php - About 2 hrs to fix

            Method tryReset has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function tryReset( User $user, array $reqs ) {
                    $data = $this->manager->getAuthenticationSessionData( 'reset-pass' );
                    if ( !$data ) {
                        return AuthenticationResponse::newAbstain();
                    }
            Severity: Major
            Found in includes/auth/ResetPasswordSecondaryAuthenticationProvider.php - About 2 hrs to fix

              Method freeLocksOnServer has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function freeLocksOnServer( $lockSrv, array $pathsByType ) {
                      $status = StatusValue::newGood();
              
                      $pathList = array_merge( ...array_values( $pathsByType ) );
              
              
              Severity: Major
              Found in includes/libs/lockmanager/RedisLockManager.php - About 2 hrs to fix

                Method getHelpInfo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getHelpInfo( $name, $settings, array $options ) {
                        $settings = $this->normalizeSettings( $settings );
                        $typeDef = $this->getTypeDef( $settings[self::PARAM_TYPE] );
                
                        // Define ordering. Some are overwritten below, some expected from the TypeDef
                Severity: Major
                Found in includes/libs/ParamValidator/ParamValidator.php - About 2 hrs to fix

                  Method tempExecute has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function tempExecute( LocalFile $file ): void {
                          $context = $this->getContext();
                          $title = $this->getTitle();
                          $article = $this->getArticle();
                          $outputPage = $context->getOutput();
                  Severity: Major
                  Found in includes/actions/FileDeleteAction.php - About 2 hrs to fix

                    Method getInputOOUI has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getInputOOUI( $value ) {
                            $this->mParent->getOutput()->addModules( 'oojs-ui-widgets' );
                    
                            // Reject nested arrays (T274955)
                            $value = array_filter( $value, 'is_scalar' );
                    Severity: Major
                    Found in includes/htmlform/fields/HTMLMultiSelectField.php - About 2 hrs to fix

                      Method removeDotSegments has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function removeDotSegments( string $urlPath ): string {
                              $output = '';
                              $inputOffset = 0;
                              $inputLength = strlen( $urlPath );
                      
                      
                      Severity: Major
                      Found in includes/utils/UrlUtils.php - About 2 hrs to fix

                        Method validateSignature has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function validateSignature( string $signature ) {
                                $pstSignature = $this->applyPreSaveTransform( $signature );
                                if ( $pstSignature === false ) {
                                    // Return early because the rest of the validation uses wikitext parsing, which requires
                                    // the pre-save transform to be applied first, and we just found out that the result of the
                        Severity: Major
                        Found in includes/preferences/SignatureValidator.php - About 2 hrs to fix

                          Method debugInfo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function debugInfo( ParserOutput $po ): string {
                                  $text = '';
                          
                                  $limitReportData = $po->getLimitReportData();
                                  // If nothing set it, we can't get it.
                          Severity: Major
                          Found in includes/OutputTransform/Stages/RenderDebugInfo.php - About 2 hrs to fix

                            Method replaceHeadings has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function replaceHeadings( string $text, array $options ): string {
                                    $skin = $this->resolveSkin( $options );
                                    $useLegacyHeading = $this->options->get( MainConfigNames::ParserEnableLegacyHeadingDOM );
                                    if ( $skin && !$skin->getOptions()['supportsMwHeading'] ) {
                                        $useLegacyHeading = true;
                            Severity: Major
                            Found in includes/OutputTransform/Stages/HandleSectionLinks.php - About 2 hrs to fix

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

                                  public function getAllowedParams() {
                                      $ret = parent::getAllowedParams() + [
                                          'user' => [
                                              ParamValidator::PARAM_TYPE => 'user',
                                              UserDef::PARAM_ALLOWED_USER_TYPES => [ 'name', 'ip', 'temp', 'id', 'interwiki' ],
                              Severity: Major
                              Found in includes/api/ApiQueryAllDeletedRevisions.php - About 2 hrs to fix

                                Method setVals has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function setVals( &$vals, $prefix, $rev ) {
                                        if ( $rev ) {
                                            $title = Title::newFromLinkTarget( $rev->getPageAsLinkTarget() );
                                            if ( isset( $this->props['ids'] ) ) {
                                                $vals["{$prefix}id"] = $title->getArticleID();
                                Severity: Major
                                Found in includes/api/ApiComparePages.php - About 2 hrs to fix

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

                                      public function getAllowedParams() {
                                          $settings = self::$settings[$this->getModuleName()];
                                  
                                          $ret = [
                                              'prop' => [
                                  Severity: Major
                                  Found in includes/api/ApiQueryBacklinksprop.php - About 2 hrs to fix

                                    Method showSearchForm has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function showSearchForm() {
                                            $out = $this->getOutput();
                                            $out->setPageTitleMsg( $this->msg( 'undelete-search-title' ) );
                                            $fuzzySearch = $this->getRequest()->getVal( 'fuzzy', '1' );
                                    
                                    
                                    Severity: Major
                                    Found in includes/specials/SpecialUndelete.php - About 2 hrs to fix

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

                                          public function __construct(
                                              array $options = [],
                                              IContextSource $context = null,
                                              LinkRenderer $linkRenderer = null,
                                              LocalRepo $localRepo = null,
                                      Severity: Major
                                      Found in includes/specials/forms/UploadForm.php - About 2 hrs to fix

                                        Method buildForm has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function buildForm( IContextSource $context ) {
                                                $mediaTypesText = array_map( function ( $type ) {
                                                    // mediastatistics-header-unknown, mediastatistics-header-bitmap,
                                                    // mediastatistics-header-drawing, mediastatistics-header-audio,
                                                    // mediastatistics-header-video, mediastatistics-header-multimedia,
                                        Severity: Major
                                        Found in includes/specials/SpecialNewFiles.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language