wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method splitNamespaceAndSlot has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function splitNamespaceAndSlot( $namespaceAndSlot ) {
        if ( is_int( $namespaceAndSlot ) ) {
            return [ $namespaceAndSlot, SlotRecord::MAIN ];
        }

Severity: Minor
Found in data-access/src/EntitySourceDefinitionsConfigParser.php - About 1 hr to fix

    Method assertConstructFieldsAreCorrect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function assertConstructFieldsAreCorrect( array $fields ) {
            Assert::parameter(
                count( $fields ) === count( self::FIELD_NAMES ) &&
                !array_diff( self::FIELD_NAMES, array_keys( $fields ) ),
                '$fields',
    Severity: Minor
    Found in lib/includes/TermIndexEntry.php - About 1 hr to fix

      Function mwApiRejectionToError has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private mwApiRejectionToError( code: string, arg2: unknown, _arg3: unknown, _arg4: unknown ): never {
              switch ( code ) {
                  case 'http': { // jQuery AJAX failure
                      const detail = arg2 as {
                          xhr: jqXHR;
      Severity: Minor
      Found in client/data-bridge/src/data-access/ApiCore.ts - About 1 hr to fix

        Function dispatch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public dispatch( selectedElement: SelectedElement ): void {
                const dialog = prepareContainer( this.mwWindow.OO, this.mwWindow.$, Dispatcher.APP_DOM_CONTAINER_ID );
        
                const emitter = this.app.launch(
                    ( this.vue as MwVueConstructor ).createMwApp,
        Severity: Minor
        Found in client/data-bridge/src/mediawiki/Dispatcher.ts - About 1 hr to fix

          Function _onSuccess has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _onSuccess: function () {
                      var mwApi = new mw.Api(),
                          itemUri = this._linkRepoTitle(
                              'Special:ItemByTitle/' + this.options.globalSiteId + '/' + this.options.pageTitle
                          );
          Severity: Minor
          Found in client/resources/jquery.wikibase/jquery.wikibase.linkitem.js - About 1 hr to fix

            Function _createReferencesListview has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _createReferencesListview: function ( references ) {
                        var self = this;
            
                        var $listview = this.$references.children( '.wikibase-listview' );
                        if ( !$listview.length ) {
            Severity: Minor
            Found in view/resources/jquery/wikibase/jquery.wikibase.statementview.js - About 1 hr to fix

              Function _initMenu has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _initMenu: function ( ooMenu ) {
                          var self = this;
              
                          $.ui.suggester.prototype._initMenu.apply( this, arguments );
              
              
              Severity: Minor
              Found in client/resources/jquery.wikibase/jquery.wikibase.siteselector.js - About 1 hr to fix

                Function _initMenu has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _initMenu: function ( ooMenu ) {
                            var self = this;
                
                            $.ui.suggester.prototype._initMenu.apply( this, arguments );
                
                
                Severity: Minor
                Found in view/resources/jquery/wikibase/jquery.wikibase.siteselector.js - About 1 hr to fix

                  Function _createStatementlistview has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _createStatementlistview: function () {
                              var self = this,
                                  prefix;
                  
                              var $statementlistview = this.element.find( '.wikibase-statementlistview' );

                    Method getBadges has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getBadges( string $prefixedItemId, ?string $globalSiteId ): array {
                            $globalSiteId = $globalSiteId ?: $this->siteId;
                    
                            try {
                                $itemId = new ItemId( $prefixedItemId );

                      Method getCentralDescriptions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getCentralDescriptions( array $titlesByPageId ) {
                              if ( !$titlesByPageId ) {
                                  return [];
                              }
                      
                      
                      Severity: Minor
                      Found in client/includes/Store/DescriptionLookup.php - About 1 hr to fix

                        Method newEntityRevisionLookup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function newEntityRevisionLookup() {
                                // Maintain a list of watchers to be notified of changes to any entities,
                                // in order to update caches.
                                /** @var WikiPageEntityStore $dispatcher */
                                $dispatcher = $this->getEntityStoreWatcher();
                        Severity: Minor
                        Found in repo/includes/Store/Sql/SqlStore.php - About 1 hr to fix

                          Method getUsagesForPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getUsagesForPage( int $pageId ): array {
                                  $usages = $this->usageLookup->getUsagesForPage( $pageId );
                                  $title = $this->titleFactory->newFromID( $pageId );
                                  if ( !$title ) {
                                      return $usages;
                          Severity: Minor
                          Found in client/includes/Usage/ImplicitDescriptionUsageLookup.php - About 1 hr to fix

                            Method displayUndoDiff has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function displayUndoDiff( EntityContentDiff $diff ): void {
                                    $tableClass = 'diff diff-contentalign-' . $this->getTitle()->getPageLanguage()->alignStart();
                            
                                    // add Wikibase styles, the diff may include entity links with labels, including fallback indicators
                                    $this->getOutput()->addModuleStyles( [ 'wikibase.alltargets' ] );
                            Severity: Minor
                            Found in repo/includes/Actions/EditEntityAction.php - About 1 hr to fix

                              Method getApiFormatReferenceSpec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getApiFormatReferenceSpec( array $clientSettings ): ?array {
                                      // This API module is (for now) only enabled conditionally
                                      if ( !( $clientSettings['dataBridgeEnabled'] ?? false ) ) {
                                          return null;
                                      }
                              Severity: Minor
                              Found in client/includes/Hooks/ExtensionLoadHandler.php - About 1 hr to fix

                                Method outputForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function outputForm( array $sites, $itemString ) {
                                        $formDescriptor = [
                                            'site' => [
                                                'name' => 'site',
                                                'default' => implode( ',', $sites ),
                                Severity: Minor
                                Found in repo/includes/Specials/SpecialGoToLinkedPage.php - About 1 hr to fix

                                  Method parseStringValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function parseStringValue( ValueParser $parser, string $value, ?ValueValidator $validator ): array {
                                          $result = [
                                              'raw' => $value,
                                          ];
                                  
                                  
                                  Severity: Minor
                                  Found in repo/includes/Api/ParseValue.php - About 1 hr to fix

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

                                        protected function getAllowedParams(): array {
                                            return array_merge(
                                                [
                                                    'claim' => [
                                                        ParamValidator::PARAM_TYPE => 'text',
                                    Severity: Minor
                                    Found in repo/includes/Api/SetClaim.php - About 1 hr to fix

                                      Method buildTermSearchMatchDisplayEntry has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function buildTermSearchMatchDisplayEntry( TermSearchResult $match, array $entry ): array {
                                              $entry['display'] = [];
                                              ApiResult::setArrayType( $entry['display'], 'assoc' );
                                      
                                              $displayLabel = $match->getDisplayLabel();
                                      Severity: Minor
                                      Found in repo/includes/Api/SearchEntities.php - About 1 hr to fix

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

                                            public function execute(): void {
                                                $params = $this->extractRequestParams();
                                                $this->validateParameters( $params );
                                        
                                                $guid = $params['statement'];
                                        Severity: Minor
                                        Found in repo/includes/Api/RemoveReferences.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language