wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

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

        PatchItemValidator $validator,
        AssertItemExists $assertItemExists,
        AssertUserIsAuthorized $assertUserIsAuthorized,
        ItemRetriever $itemRetriever,
        ItemSerializer $itemSerializer,
Severity: Major
Found in repo/rest-api/src/Application/UseCases/PatchItem/PatchItem.php - About 1 hr to fix

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

            PatchItemAliasesValidator $useCaseValidator,
            AssertItemExists $assertItemExists,
            AssertUserIsAuthorized $assertUserIsAuthorized,
            ItemAliasesRetriever $aliasesRetriever,
            AliasesSerializer $aliasesSerializer,

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

              PropertyLabelsRetriever $labelsRetriever,
              LabelsSerializer $labelsSerializer,
              PatchJson $patcher,
              PropertyWriteModelRetriever $propertyRetriever,
              PropertyUpdater $propertyUpdater,

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

                TemplateFactory $templateFactory,
                SiteList $sites,
                EditSectionGenerator $sectionEditLinkGenerator,
                EntityIdFormatter $entityIdFormatter,
                LanguageNameLookup $languageNameLookup,
        Severity: Major
        Found in view/src/SiteLinksView.php - About 1 hr to fix

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

                  AssertItemExists $assertItemExists,
                  ItemLabelsRetriever $labelsRetriever,
                  LabelsSerializer $labelsSerializer,
                  PatchJson $patcher,
                  PatchedItemLabelsValidator $patchedLabelsValidator,

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

                    PatchItemDescriptionsValidator $requestValidator,
                    AssertItemExists $assertItemExists,
                    AssertUserIsAuthorized $assertUserIsAuthorized,
                    ItemDescriptionsRetriever $descriptionsRetriever,
                    DescriptionsSerializer $descriptionsSerializer,

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

                      DatabaseEntitySource $localEntitySource,
                      StringNormalizer $stringNormalizer,
                      TypeIdsAcquirer $typeIdsAcquirer,
                      TypeIdsLookup $typeIdsLookup,
                      TypeIdsResolver $typeIdsResolver,
              Severity: Major
              Found in lib/includes/Store/Sql/Terms/TermStoreWriterFactory.php - About 1 hr to fix

                Function getListItemAdapterForSiteLinkView has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    SELF.prototype.getListItemAdapterForSiteLinkView = function ( startEditingCallback, getAllowedSites, removeCallback ) {
                        var self = this;
                        return new $.wikibase.listview.ListItemAdapter( {
                            listItemWidget: $.wikibase.sitelinkview,
                            getNewItem: function ( value, dom ) {
                Severity: Minor
                Found in view/resources/wikibase/view/ViewFactory.js - About 1 hr to fix

                  Function getStatementGroupListView has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      SELF.prototype.getStatementGroupListView = function ( startEditingCallback, entity, $statementgrouplistview, htmlIdPrefix ) {
                          var statementGroupSet = entity.getStatements();
                  
                          function getStatementForGuid( guid ) {
                              var res = null;
                  Severity: Minor
                  Found in view/resources/wikibase/view/ViewFactory.js - About 1 hr to fix

                    Method render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function render(
                            EntityId $entityId,
                            $propertyLabelOrId,
                            array $acceptableRanks = null
                        ) {
                    Severity: Minor
                    Found in client/includes/DataAccess/StatementTransclusionInteractor.php - About 1 hr to fix

                      Method getTermsOfEntities has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getTermsOfEntities( array $entityIds, array $termTypes, string $languageCode ): array {
                              $this->termBuffer->prefetchTerms( $entityIds, $termTypes, [ $languageCode ] );
                      
                              $terms = [];
                              foreach ( $entityIds as $entityId ) {
                      Severity: Minor
                      Found in client/includes/Api/PageTerms.php - About 1 hr to fix

                        Method getTerm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getTerm( EntityId $entityId, string $languageCode, string $termType ): ?string {
                                $resolutionResult = $this->redirectResolvingLatestRevisionLookup->lookupLatestRevisionResolvingRedirect( $entityId );
                                if ( $resolutionResult === null ) {
                                    return null;
                                }

                          Method getTermsOfEntities has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function getTermsOfEntities( array $entityIds, array $termTypes, string $languageCode ): array {
                                  $this->termBuffer->prefetchTerms( $entityIds, $termTypes, [ $languageCode ] );
                          
                                  $terms = [];
                                  foreach ( $entityIds as $entityId ) {
                          Severity: Minor
                          Found in repo/includes/Api/EntityTerms.php - About 1 hr to fix

                            Method processArguments has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function processArguments( $subPage ) {
                                    parent::processArguments( $subPage );
                            
                                    $request = $this->getRequest();
                                    // explode the subpage from the format Special:SetSitelink/q123/enwiki
                            Severity: Minor
                            Found in repo/includes/Specials/SpecialSetSiteLink.php - About 1 hr to fix

                              Method getMultiSelectForBadges has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function getMultiSelectForBadges() {
                                      $options = [];
                                      $default = [];
                              
                                      /** @var ItemId[] $badgeItemIds */
                              Severity: Minor
                              Found in repo/includes/Specials/SpecialSetSiteLink.php - About 1 hr to fix

                                Method getExamplesMessages has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function getExamplesMessages(): array {
                                        return [
                                            "action=wbgetentities&ids=Q42"
                                            => "apihelp-wbgetentities-example-1",
                                            "action=wbgetentities&ids=P17"
                                Severity: Minor
                                Found in repo/includes/Api/GetEntities.php - About 1 hr to fix

                                  Method formatResult has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function formatResult( IResultWrapper $res, int $limit, array $props ): void {
                                          $currentEntity = null;
                                          $count = 0;
                                          $result = $this->getResult();
                                          $props = array_flip( $props );
                                  Severity: Minor
                                  Found in repo/includes/Api/ListSubscribers.php - About 1 hr to fix

                                    Method validateDescriptionText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function validateDescriptionText( string $descriptionText, string $language ): ?ValidationError {
                                            $result = $this->termValidatorFactory
                                                ->getDescriptionValidator()
                                                ->validate( $descriptionText );
                                            if ( !$result->isValid() ) {

                                      Method deserialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function deserialize( string $dataTypeId, array $valueSerialization, string $basePath = '' ): DataValue {
                                              $this->assertFieldExists( $valueSerialization, 'content', $basePath );
                                      
                                              // phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.Found
                                              switch ( $dataValueType = $this->valueTypeLookup->getValueType( $dataTypeId ) ) {
                                      Severity: Minor
                                      Found in repo/rest-api/src/Infrastructure/DataValuesValueDeserializer.php - About 1 hr to fix

                                        Method validateLabelText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function validateLabelText( string $labelText, string $language ): ?ValidationError {
                                                $result = $this->termValidatorFactory
                                                    ->getLabelValidator( Property::ENTITY_TYPE )
                                                    ->validate( $labelText );
                                                if ( !$result->isValid() ) {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language