wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function bridge has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.widget.bridge = function( name, object ) {
    var fullName = object.prototype.widgetFullName || name;
    $.fn[ name ] = function( options ) {
        var isMethodCall = typeof options === "string",
            args = slice.call( arguments, 1 ),
Severity: Minor
Found in resources/lib/jquery.ui/jquery.ui.widget.js - About 1 hr to fix

    Function set_up_html has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Chosen.prototype.set_up_html = function() {
          var container_classes, container_props;
          container_classes = ["chosen-container"];
          container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
          if (this.inherit_select_classes && this.form_field.className) {
    Severity: Minor
    Found in resources/lib/jquery.chosen/chosen.jquery.js - About 1 hr to fix

      Function installModule has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function installModule (store, rootState, path, module, hot) {
          var isRoot = !path.length;
          var namespace = store._modules.getNamespace(path);
      
          // register in namespace map
      Severity: Minor
      Found in resources/lib/vuex/vuex.global.js - About 1 hr to fix

        Method internalAllowed has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function internalAllowed(
                string $action,
                ?PermissionStatus $status,
                $limitRate,
                ?Block $userBlock
        Severity: Minor
        Found in includes/Permissions/UserAuthority.php - About 1 hr to fix

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

              public function run() {
                  $services = MediaWikiServices::getInstance();
                  $dbProvider = $services->getConnectionProvider();
                  $rowsPerQuery = $services->getMainConfig()->get( MainConfigNames::UpdateRowsPerQuery );
          
          
          Severity: Minor
          Found in includes/watchlist/ClearWatchlistNotificationsJob.php - About 1 hr to fix

            Method removeExpired has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function removeExpired( int $limit, bool $deleteOrphans = false ): void {
                    $dbr = $this->lbFactory->getReplicaDatabase();
                    $dbw = $this->lbFactory->getPrimaryDatabase();
                    $ticket = $this->lbFactory->getEmptyTransactionTicket( __METHOD__ );
            
            
            Severity: Minor
            Found in includes/watchlist/WatchedItemStore.php - About 1 hr to fix

              Method fetch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function fetch( string $src, $integrity, string $moduleName ) {
                      if ( $integrity !== null ) {
                          $key = $this->cacheKey( $src, $integrity, $moduleName );
                          $data = $this->cacheGet( $key );
                          if ( $data ) {
              Severity: Minor
              Found in includes/ResourceLoader/ForeignResourceManager.php - About 1 hr to fix

                Method newFilteringDispatcher has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function newFilteringDispatcher( TreeBuilder $treeBuilder, $nodeName ) {
                        return new class( $treeBuilder, $nodeName ) extends Dispatcher {
                            private $nodeName;
                            private $nodeDepth = 0;
                            private $seenTag = false;
                Severity: Minor
                Found in includes/ResourceLoader/VueComponentParser.php - About 1 hr to fix

                  Method applyFeaturesCompatibility has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected static function applyFeaturesCompatibility(
                          array $features, bool $addUnspecifiedFeatures = true, &$messages = ''
                      ): array {
                          if ( isset( $features[ 'i18n-all-lists-margins' ] ) ) {
                              // Emit warning only. Key is supported as-is.
                  Severity: Minor
                  Found in includes/ResourceLoader/SkinModule.php - About 1 hr to fix

                    Method expandPackageFiles has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function expandPackageFiles( Context $context ) {
                            $hash = $context->getHash();
                            if ( isset( $this->expandedPackageFiles[$hash] ) ) {
                                return $this->expandedPackageFiles[$hash];
                            }
                    Severity: Minor
                    Found in includes/ResourceLoader/FileModule.php - About 1 hr to fix

                      Method displayViewSourcePage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function displayViewSourcePage( Content $content, string $errorMessage ): void {
                              $out = $this->context->getOutput();
                              $this->getHookRunner()->onEditPage__showReadOnlyForm_initial( $this, $out );
                      
                              $out->setRobotPolicy( 'noindex,nofollow' );
                      Severity: Minor
                      Found in includes/editpage/EditPage.php - About 1 hr to fix

                        Method outputPageStreamBatch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function outputPageStreamBatch( $results, $lastRow ) {
                                $rowCarry = null;
                                while ( true ) {
                                    $slotRows = $this->getSlotRowBatch( $results, $rowCarry );
                        
                        
                        Severity: Minor
                        Found in includes/export/WikiExporter.php - About 1 hr to fix

                          Method sendCommand has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function sendCommand( ...$args ) {
                                  $args = str_replace( ' ', '%20', $args );
                                  $cmd = implode( ' ', $args );
                                  $status = $this->getConn();
                                  if ( !$status->isOK() ) {
                          Severity: Minor
                          Found in includes/poolcounter/PoolCounterClient.php - About 1 hr to fix

                            Method getPage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function getPage( ?int $pageId, ?int $revId, int $queryFlags = IDBAccessObject::READ_NORMAL ) {
                                    if ( !$pageId && !$revId ) {
                                        throw new InvalidArgumentException( '$pageId and $revId cannot both be 0 or null' );
                                    }
                            
                            
                            Severity: Minor
                            Found in includes/Revision/RevisionStore.php - About 1 hr to fix

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

                                  public function __construct( \stdClass $row, $content, bool $derived = false ) {
                                      Assert::parameterType( [ 'Content', 'callable' ], $content, '$content' );
                              
                                      Assert::parameter(
                                          property_exists( $row, 'slot_revision_id' ),
                              Severity: Minor
                              Found in includes/Revision/SlotRecord.php - About 1 hr to fix

                                Method updateSlotsOn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function updateSlotsOn(
                                        RevisionRecord $revision,
                                        RevisionSlotsUpdate $revisionSlotsUpdate,
                                        IDatabase $dbw
                                    ): array {
                                Severity: Minor
                                Found in includes/Revision/RevisionStore.php - About 1 hr to fix

                                  Method getRelativeRevision has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function getRelativeRevision( RevisionRecord $rev, $flags, $dir ) {
                                          $op = $dir === 'next' ? '>' : '<';
                                          $sort = $dir === 'next' ? 'ASC' : 'DESC';
                                  
                                          $revisionIdValue = $rev->getId( $this->wikiId );
                                  Severity: Minor
                                  Found in includes/Revision/RevisionStore.php - About 1 hr to fix

                                    Method mergeViaCas has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        final protected function mergeViaCas( $key, callable $callback, $exptime, $attempts, $flags ) {
                                            $attemptsLeft = $attempts;
                                            do {
                                                $token = self::PASS_BY_REF;
                                                // Get the old value and CAS token from cache
                                    Severity: Minor
                                    Found in includes/libs/objectcache/MediumSpecificBagOStuff.php - About 1 hr to fix

                                      Method __toString has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function __toString() {
                                              $status = $this->isOK() ? "OK" : "Error";
                                              if ( count( $this->errors ) ) {
                                                  $errorcount = "collected " . ( count( $this->errors ) ) . " message(s) on the way";
                                              } else {
                                      Severity: Minor
                                      Found in includes/libs/StatusValue.php - About 1 hr to fix

                                        Method get has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function get( $key, $flags = 0 ) {
                                                $args = func_get_args();
                                        
                                                if ( $this->fieldHasFlags( $flags, self::READ_LATEST ) ) {
                                                    // If the latest write was a delete(), we do NOT want to fallback
                                        Severity: Minor
                                        Found in includes/libs/objectcache/MultiWriteBagOStuff.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language