wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

MWDebug has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class MWDebug {
    /**
     * Log lines
     *
     * @var array
Severity: Minor
Found in includes/debug/MWDebug.php - About 2 hrs to fix

    File MessagesFrp.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /** Franco-Provençal (arpetan)
     *
     * @file
     * @ingroup Languages
    Severity: Minor
    Found in languages/messages/MessagesFrp.php - About 2 hrs to fix

      Function ajax has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              ajax: function ( parameters, ajaxOptions ) {
                  const api = this,
                      apiDeferred = $.Deferred();
      
                  parameters = Object.assign( {}, this.defaults.parameters, parameters );
      Severity: Major
      Found in resources/src/mediawiki.api/index.js - About 2 hrs to fix

        Function buildHeaders has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function buildHeaders( table, msg ) {
                let config = $( table ).data( 'tablesorter' ).config,
                    maxSeen = 0,
                    colspanOffset = 0,
                    $tableHeaders = $( [] ),
        Severity: Major
        Found in resources/src/jquery.tablesorter/jquery.tablesorter.js - About 2 hrs to fix

          Function MwRcfiltersUiSaveFiltersPopupButtonWidget has 70 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const SaveFiltersPopupButtonWidget = function MwRcfiltersUiSaveFiltersPopupButtonWidget( controller, model, config ) {
              const $popupContent = $( '<div>' );
          
              config = config || {};
          
          
          Severity: Major
          Found in resources/src/mediawiki.rcfilters/ui/SaveFiltersPopupButtonWidget.js - About 2 hrs to fix

            Function toggle has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            OO.ui.MenuSelectWidget.prototype.toggle = function ( visible ) {
                visible = ( visible === undefined ? !this.visible : !!visible ) && !!this.items.length;
                const change = visible !== this.isVisible();
            
                if ( visible && !this.warnedUnattached && !this.isElementAttached() ) {
            Severity: Major
            Found in resources/lib/ooui/oojs-ui-core.js - About 2 hrs to fix

              Function formatDate has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  formatDate: function (format, date, settings) {
                      if (!date)
                          return '';
                      var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
                      var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.datepicker.js - About 2 hrs to fix

                Function widget has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.widget = function( name, base, prototype ) {
                    var fullName, existingConstructor, constructor, basePrototype,
                        namespace = name.split( "." )[ 0 ];
                
                    name = name.split( "." )[ 1 ];
                Severity: Major
                Found in resources/lib/jquery.ui/jquery.ui.widget.js - About 2 hrs to fix

                  Method doNormalizeJsonSchema has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function doNormalizeJsonSchema(
                          array $schema,
                          array &$defs,
                          string $source,
                          string $propertyName,
                  Severity: Major
                  Found in includes/Settings/Source/JsonSchemaTrait.php - About 2 hrs to fix

                    Method loadFromDefinition has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function loadFromDefinition() {
                            if ( $this->definition === null ) {
                                return;
                            }
                    
                    
                    Severity: Major
                    Found in includes/ResourceLoader/ImageModule.php - About 2 hrs to fix

                      Method getOneModuleResponse has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getOneModuleResponse( Context $context, $name, Module $module ) {
                              $only = $context->getOnly();
                              // Important: Do not cache minifications of embedded modules
                              // This is especially for the private 'user.options' module,
                              // which varies on every pageview and would explode the cache (T84960)
                      Severity: Major
                      Found in includes/ResourceLoader/ResourceLoader.php - About 2 hrs to fix

                        Method loadRevisionData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function loadRevisionData() {
                                if ( $this->mRevisionsLoaded ) {
                                    return $this->isContentOverridden ||
                                    ( $this->mOldRevisionRecord !== null && $this->mNewRevisionRecord !== null );
                                }
                        Severity: Major
                        Found in includes/diff/DifferenceEngine.php - About 2 hrs to fix

                          Method readCentralDirectory has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function readCentralDirectory( $offset, $size ) {
                                  $block = $this->getBlock( $offset, $size );
                          
                                  $fixedInfo = [
                                      'signature' => [ 'string', 4 ],
                          Severity: Major
                          Found in includes/utils/ZipDirectoryReader.php - About 2 hrs to fix

                            Method handleCORS has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function handleCORS() {
                                    $originParam = $this->getParameter( 'origin' ); // defaults to null
                                    if ( $originParam === null ) {
                                        // No origin parameter, nothing to do
                                        return true;
                            Severity: Major
                            Found in includes/api/ApiMain.php - About 2 hrs to fix

                              Method checkConditionalRequestHeaders has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function checkConditionalRequestHeaders( $module ) {
                                      if ( $this->mInternalMode ) {
                                          // No headers to check in internal mode
                                          return true;
                                      }
                              Severity: Major
                              Found in includes/api/ApiMain.php - About 2 hrs to fix

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

                                    public function execute( $par ) {
                                        $this->setHeaders();
                                        $this->outputHeader();
                                
                                        $out = $this->getOutput();
                                Severity: Major
                                Found in includes/specials/SpecialLinkSearch.php - About 2 hrs to fix

                                  Method transform has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function transform( $params, $flags = 0 ) {
                                          $thumbnailEpoch = MediaWikiServices::getInstance()->getMainConfig()
                                              ->get( MainConfigNames::ThumbnailEpoch );
                                  
                                          do {
                                  Severity: Major
                                  Found in includes/filerepo/file/File.php - About 2 hrs to fix

                                    Method setOriginal has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function setOriginal( $rev, $originalRendering ) {
                                            if ( $originalRendering instanceof ParsoidRenderID ) {
                                                $renderId = $originalRendering;
                                    
                                                // If the client asked for a render ID, load original data from stash
                                    Severity: Major
                                    Found in includes/Rest/Handler/Helper/HtmlInputTransformHelper.php - About 2 hrs to fix

                                      Method moveIllegalPage has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function moveIllegalPage( $row ) {
                                              $legalChars = Title::legalChars();
                                              $legalizedUnprefixed = preg_replace_callback( "/([^$legalChars])/",
                                                  [ $this, 'hexChar' ],
                                                  $row->page_title );
                                      Severity: Major
                                      Found in maintenance/cleanupTitles.php - About 2 hrs to fix

                                        Method moveInconsistentPage has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function moveInconsistentPage( $row, Title $title ) {
                                                $titleImpossible = $title->getInterwiki() || !$title->canExist();
                                                if ( $title->exists( IDBAccessObject::READ_LATEST ) || $titleImpossible ) {
                                                    if ( $titleImpossible ) {
                                                        $prior = $title->getPrefixedDBkey();
                                        Severity: Major
                                        Found in maintenance/cleanupTitles.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language