wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method factory has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ApiMain $apiMain,
        string $moduleName,
        SiteLookup $siteLookup,
        IBufferingStatsdDataFactory $stats,
        ApiHelperFactory $apiHelperFactory,
Severity: Major
Found in repo/includes/Api/GetEntities.php - About 1 hr to fix

    Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            ApiMain $mainModule,
            string $moduleName,
            ApiErrorReporter $errorReporter,
            Deserializer $statementDeserializer,
            StatementChangeOpFactory $statementChangeOpFactory,
    Severity: Major
    Found in repo/includes/Api/SetClaim.php - About 1 hr to fix

      Method factory has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              InterwikiLookup $interwikiLookup,
              SpecialPageFactory $specialPageFactory,
              EntityExistenceChecker $entityExistenceChecker,
              EntityIdParser $entityIdParser,
              EntityLinkFormatterFactory $entityLinkFormatterFactory,
      Severity: Major
      Found in repo/includes/Hooks/HtmlPageLinkRendererEndHookHandler.php - About 1 hr to fix

        Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                FingerprintChangeOpFactory $fingerprintChangeOpFactory,
                StatementChangeOpFactory $statementChangeOpFactory,
                SiteLinkChangeOpFactory $siteLinkChangeOpFactory,
                TermChangeOpSerializationValidator $termChangeOpSerializationValidator,
                SiteLinkBadgeChangeOpSerializationValidator $badgeChangeOpSerializationValidator,

          Method onShowSearchHit has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function onShowSearchHit( $searchPage, $result,
                  $terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related,
                  &$html
          Severity: Major
          Found in repo/includes/Hooks/ShowSearchHitHandler.php - About 1 hr to fix

            Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    EntityTitleStoreLookup $titleLookup,
                    EntityRevisionLookup $entityLookup,
                    EntityStore $entityStore,
                    EntityPermissionChecker $permissionChecker,
                    EntityDiffer $entityDiffer,
            Severity: Major
            Found in repo/includes/EditEntity/MediaWikiEditEntityFactory.php - About 1 hr to fix

              Function _registerTogglerForLanguagelistviewDiv has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _registerTogglerForLanguagelistviewDiv: function ( optionKey ) {
                          var self = this,
                              api = new mw.Api();
                          this.$entitytermsforlanguagelistviewToggler = $( '<div>' )
                              .addClass( 'wikibase-entitytermsview-entitytermsforlanguagelistview-toggler' )
              Severity: Minor
              Found in view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js - About 1 hr to fix

                Function _appendItem has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _appendItem: function ( item ) {
                            var self = this;
                
                            var label = this.options.manipulateLabel
                                ? this.options.manipulateLabel( item.getLabel() )
                Severity: Minor
                Found in client/resources/jquery.ui/jquery.ui.ooMenu.js - About 1 hr to fix

                  Function _create has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _create: function () {
                              if ( !this.options.getListItemAdapter
                                  || ( this.options.value && !( this.options.value instanceof datamodel.StatementList ) )
                              ) {
                                  throw new Error( 'Required option not specified properly' );
                  Severity: Minor
                  Found in view/resources/jquery/wikibase/jquery.wikibase.statementlistview.js - About 1 hr to fix

                    Function 6eeb has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    /***/ (function(module, exports, __webpack_require__) {
                    
                    var global = __webpack_require__("da84");
                    var createNonEnumerableProperty = __webpack_require__("9112");
                    var has = __webpack_require__("5135");
                    Severity: Minor
                    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

                      Method rebuildItemTerms has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function rebuildItemTerms( DatabaseUpdater $updater ) {
                              $localEntitySourceName = WikibaseRepo::getSettings()->getSetting( 'localEntitySourceName' );
                              $itemSource = WikibaseRepo::getEntitySourceDefinitions()
                                  ->getDatabaseSourceForEntityType( 'item' );
                              if ( $itemSource === null || $itemSource->getSourceName() !== $localEntitySourceName ) {
                      Severity: Minor
                      Found in repo/includes/Store/Sql/DatabaseSchemaUpdater.php - About 1 hr to fix

                        Method getParser has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getParser(): ValueParser {
                                $params = $this->extractRequestParams();
                        
                                $options = $this->getOptionsObject( $params['options'] );
                        
                        
                        Severity: Minor
                        Found in repo/includes/Api/ParseValue.php - About 1 hr to fix

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

                              public function execute( $subPage ): void {
                                  $this->setHeaders();
                                  $this->outputHeader();
                          
                                  $this->getOutput()->addWikiMsg( 'wikibase-mylanguagefallbackchain-text' );
                          Severity: Minor
                          Found in repo/includes/Specials/SpecialMyLanguageFallbackChain.php - About 1 hr to fix

                            Method modifyEntity has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function modifyEntity( EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters ): Summary {
                                    $data = $preparedParameters[self::PARAM_DATA];
                            
                                    $exists = $this->entityExists( $entity->getId() );
                            
                            
                            Severity: Minor
                            Found in repo/includes/Api/EditEntity.php - About 1 hr to fix

                              Method onShowSearchHit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function onShowSearchHit( $searchPage, $result,
                                      $terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related,
                                      &$html
                                  ): void {
                                      if ( $result instanceof ExtendedResult ) {
                              Severity: Minor
                              Found in repo/includes/Hooks/ShowSearchHitHandler.php - About 1 hr to fix

                                Method newPlaceHolderEmittingEntityTermsView has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function newPlaceHolderEmittingEntityTermsView(
                                        EntityDocument $entity,
                                        Language $language,
                                        TermLanguageFallbackChain $termFallbackChain
                                    ) {
                                Severity: Minor
                                Found in repo/includes/ParserOutput/EntityTermsViewFactory.php - About 1 hr to fix

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

                                      public function __construct() {
                                          parent::__construct();
                                  
                                          $this->addDescription( 'Generate a ' . $this->getDumpType() . ' dump from entities in the repository.' );
                                  
                                  
                                  Severity: Minor
                                  Found in repo/maintenance/DumpEntities.php - About 1 hr to fix

                                    Method throwUseCaseError has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function throwUseCaseError( ValidationError $validationError ): void {
                                            $context = $validationError->getContext();
                                            switch ( $validationError->getCode() ) {
                                                case LanguageCodeValidator::CODE_INVALID_LANGUAGE_CODE:
                                                    throw UseCaseError::newPatchResultInvalidKey( '', $context[LanguageCodeValidator::CONTEXT_LANGUAGE_CODE] );

                                      Method findActuallyUnusedTermInLangIds has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function findActuallyUnusedTermInLangIds( array $termInLangIds, IDatabase $dbw ) {
                                              $unusedTermInLangIds = [];
                                              foreach ( $termInLangIds as $termInLangId ) {
                                                  // Note: Not batching here is intentional to avoid deadlocks (see method comment)
                                                  $usedInProperties = $dbw->newSelectQueryBuilder()
                                      Severity: Minor
                                      Found in lib/includes/Store/Sql/Terms/FindUnusedTermTrait.php - About 1 hr to fix

                                        Function validateBridgeApplicability has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public validateBridgeApplicability(
                                                path: MainSnakPath,
                                            ): Promise<unknown> {
                                                if ( this.state.applicationStatus === ApplicationStatus.SAVED ) {
                                                    // saving edits can transition us from applicable to inapplicable states, but that should not be an error
                                        Severity: Minor
                                        Found in client/data-bridge/src/store/actions.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language