wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function animateClass has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.effects.animateClass = function( value, duration, easing, callback ) {
    var o = $.speed( duration, easing, callback );

    return this.queue( function() {
        var animated = $( this ),
Severity: Minor
Found in resources/lib/jquery.ui/jquery.ui.effect.js - About 2 hrs to fix

    Function Deflate has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function Deflate(options) {
        this.options = common.assign({
          level: Z_DEFAULT_COMPRESSION,
          method: Z_DEFLATED,
          chunkSize: 16384,
    Severity: Minor
    Found in resources/lib/pako/pako_deflate.js - About 2 hrs to fix

      Function _clear has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _clear: function(event, noPropagation) {
      
              this.reverting = false;
              // We delay all events that have to be triggered to after the point where the placeholder has been removed and
              // everything else normalized again
      Severity: Minor
      Found in resources/lib/jquery.ui/jquery.ui.sortable.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if (!s || s.strm !== strm || (s.status !== INIT_STATE &&
          //#ifdef GZIP
                                          s.status !== GZIP_STATE &&
          //#endif
                                          s.status !== EXTRA_STATE &&
        Severity: Critical
        Found in resources/lib/pako/pako_deflate.js - About 2 hrs to fix

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

              public function getNamespaceRestrictionLevels( $index, UserIdentity $user = null ): array {
                  if ( !isset( $this->options->get( MainConfigNames::NamespaceProtection )[$index] ) ) {
                      // All levels are valid if there's no namespace restriction.
                      // But still filter by user, if necessary
                      $levels = $this->options->get( MainConfigNames::RestrictionLevels );
          Severity: Minor
          Found in includes/Permissions/PermissionManager.php - About 2 hrs to fix

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

                public function run() {
                    $updateRowsPerQuery = MediaWikiServices::getInstance()->getMainConfig()->get(
                        MainConfigNames::UpdateRowsPerQuery );
                    $userId = $this->params['userId'];
                    $maxWatchlistId = $this->params['maxWatchlistId'];
            Severity: Minor
            Found in includes/watchlist/ClearUserWatchlistJob.php - About 2 hrs to fix

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

                  public function getOldIDFromRequest() {
                      $this->mRedirectUrl = false;
              
                      $request = $this->getContext()->getRequest();
                      $oldid = $request->getIntOrNull( 'oldid' );
              Severity: Minor
              Found in includes/page/Article.php - About 2 hrs to fix

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

                    private function getWatchedItemsWithRCInfoQueryFields( array $options ) {
                        $fields = [
                            'rc_id',
                            'rc_namespace',
                            'rc_title',
                Severity: Minor
                Found in includes/watchlist/WatchedItemQueryService.php - About 2 hrs to fix

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

                      protected function rasterize( $svg ) {
                          $svgConverter = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::SVGConverter );
                          $svgConverterPath = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::SVGConverterPath );
                          // This code should be factored out to a separate method on SvgHandler, or perhaps a separate
                          // class, with a separate set of configuration settings.
                  Severity: Minor
                  Found in includes/ResourceLoader/Image.php - About 2 hrs to fix

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

                        public function updateRevision( int $revId = 0 ) {
                            if ( $this->wasCommitted() ) {
                                throw new RuntimeException(
                                    'saveRevision() or updateRevision() has already been called on this PageUpdater!'
                                );
                    Severity: Minor
                    Found in includes/Storage/PageUpdater.php - About 2 hrs to fix

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

                          public function execute( $skipcache = false ) {
                              if ( !$this->cacheable || $skipcache ) {
                                  $status = $this->poolCounter->acquireForMe();
                              } else {
                                  if ( $this->isFastStaleEnabled() ) {
                      Severity: Minor
                      Found in includes/poolcounter/PoolCounterWork.php - About 2 hrs to fix

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

                            public function format( $diff ) {
                                $xi = $yi = 1;
                                $block = false;
                                $context = [];
                        
                        
                        Severity: Minor
                        Found in includes/libs/Diff/DiffFormatter.php - About 2 hrs to fix

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

                              public function getDirListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
                                  $dirs = [];
                                  if ( $after === INF ) {
                                      return $dirs; // nothing more
                                  }
                          Severity: Minor
                          Found in includes/libs/filebackend/SwiftFileBackend.php - About 2 hrs to fix

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

                                final protected function ingestFreshFileStats( array $stats, $latest ) {
                                    $success = true;
                            
                                    foreach ( $stats as $path => $stat ) {
                                        if ( is_array( $stat ) ) {
                            Severity: Minor
                            Found in includes/libs/filebackend/FileBackendStore.php - About 2 hrs to fix

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

                                  protected function doConcatenate( array $params ) {
                                      $status = $this->newStatus();
                                      $tmpPath = $params['dst'];
                                      unset( $params['latest'] );
                              
                              
                              Severity: Minor
                              Found in includes/libs/filebackend/FileBackendStore.php - About 2 hrs to fix

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

                                    private function readDirectory() {
                                        $dirSectorId = $this->header['first_dir_sector'];
                                        $binaryDir = '';
                                        $seenSectorIds = [];
                                        while ( $dirSectorId !== 0xFFFFFFFE ) {
                                Severity: Minor
                                Found in includes/libs/mime/MSCompoundFileReader.php - About 2 hrs to fix

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

                                      public static function fromText( DatabasePostgres $db, $table, $field ) {
                                          $q = <<<SQL
                                  SELECT
                                   attnotnull, attlen, conname AS conname,
                                   atthasdef,
                                  Severity: Minor
                                  Found in includes/libs/rdbms/field/PostgresField.php - About 2 hrs to fix

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

                                        protected function computeServerState( int $i, ?array $previousState ) {
                                            $startTime = $this->getCurrentTime();
                                            // Double check for circular recursion in computeServerStates()/getWeightScale().
                                            // Mainly, connection attempts should use LoadBalancer::getServerConnection()
                                            // rather than something that will pick a server based on the server states.
                                    Severity: Minor
                                    Found in includes/libs/rdbms/loadmonitor/LoadMonitor.php - About 2 hrs to fix

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

                                          protected function doBatchLookups() {
                                              # Do a link batch query
                                              $this->mResult->seek( 0 );
                                              $parentRevIds = [];
                                              $this->mParentLens = [];
                                      Severity: Minor
                                      Found in includes/pager/ContributionsPager.php - About 2 hrs to fix

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

                                            public function getInputOOUI( $value ) {
                                                $this->mParent->getOutput()->addModuleStyles( 'mediawiki.widgets.SelectWithInputWidget.styles' );
                                        
                                                # TextInput
                                                $textAttribs = [
                                        Severity: Minor
                                        Found in includes/htmlform/fields/HTMLSelectAndOtherField.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language