wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Function WbSites has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    wb.sites = new ( function WbSites() {

        /**
         * Will hold a list of all the sites after getSites() was called. This will cache the result.
         *
Severity: Minor
Found in repo/resources/wikibase.sites.js - About 1 hr to fix

    Function WbSites has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var wbSites = new ( function WbSites() {
    
            /**
             * Will hold a list of all the sites after getSites() was called. This will cache the result.
             *
    Severity: Minor
    Found in client/resources/wikibase.sites.js - About 1 hr to fix

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

          public function getAllowedParams(): array {
              return [
                  'prop' => [
                      ParamValidator::PARAM_ISMULTI => true,
                      ParamValidator::PARAM_TYPE => [
      Severity: Minor
      Found in client/includes/Api/ApiPropsEntityUsage.php - About 1 hr to fix

        Method newLanguageIndependentLuaBindings has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function newLanguageIndependentLuaBindings(): WikibaseLanguageIndependentLuaBindings {
                $mediaWikiServices = MediaWikiServices::getInstance();
                $settings = WikibaseClient::getSettings( $mediaWikiServices );
                $store = WikibaseClient::getStore( $mediaWikiServices );
                $termsLanguages = WikibaseClient::getTermsLanguages( $mediaWikiServices );
        Severity: Minor
        Found in client/includes/DataAccess/Scribunto/WikibaseLibrary.php - About 1 hr to fix

          Method getUnexpectedUnconnectedBatch has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getUnexpectedUnconnectedBatch(): array {
                  $dbr = $this->localConnectionManager->getReadConnection();
          
                  $lastPosition = $this->position + $this->batchSize * $this->batchSizeSelectMultiplicator;
                  $result = $dbr->newSelectQueryBuilder()
          Severity: Minor
          Found in client/includes/Store/Sql/UnexpectedUnconnectedPagePrimer.php - About 1 hr to fix

            Method newEntityDiffVisualizer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function newEntityDiffVisualizer( ?string $type = null, ?IContextSource $context = null ): EntityDiffVisualizer {
                    if ( $context === null ) {
                        $context = RequestContext::getMain();
                    }
                    $langCode = $context->getLanguage()->getCode();
            Severity: Minor
            Found in repo/includes/Diff/EntityDiffVisualizerFactory.php - About 1 hr to fix

              Method visualizeReferenceChanges has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function visualizeReferenceChanges(
                      $headerPrefix,
                      Diff $changes,
                      Snak $oldestMainSnak,
                      Snak $newestMainSnak
              Severity: Minor
              Found in repo/includes/Diff/ClaimDifferenceVisualizer.php - About 1 hr to fix

                Method findImplicitUsages has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function findImplicitUsages( array $entityIds ): array {
                        $numericItemIds = [];
                        foreach ( $entityIds as $entityId ) {
                            if ( $entityId instanceof ItemId ) {
                                $numericItemIds[] = $entityId->getNumericId();
                Severity: Minor
                Found in client/includes/Usage/ImplicitDescriptionUsageLookup.php - About 1 hr to fix

                  Method visualizeQualifierChanges has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function visualizeQualifierChanges(
                          $headerPrefix,
                          Diff $changes,
                          Snak $oldestMainSnak,
                          Snak $newestMainSnak
                  Severity: Minor
                  Found in repo/includes/Diff/ClaimDifferenceVisualizer.php - About 1 hr to fix

                    Method mergeItems has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function mergeItems(
                            ItemId $fromId,
                            ItemId $toId,
                            IContextSource $context,
                            array $ignoreConflicts = [],
                    Severity: Minor
                    Found in repo/includes/Interactors/ItemMergeInteractor.php - About 1 hr to fix

                      Method formatRow has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function formatRow( EntityId $propertyId ) {
                              $title = $this->titleLookup->getTitleForId( $propertyId );
                              $language = $this->getLanguage();
                      
                              if ( !$title->exists() ) {
                      Severity: Minor
                      Found in repo/includes/Specials/SpecialListProperties.php - About 1 hr to fix

                        Method onApiCheckCanExecute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function onApiCheckCanExecute( ApiBase $module, User $user, &$message ) {
                                if ( $module instanceof ApiEditPage ) {
                                    $params = $module->extractRequestParams();
                                    $pageObj = $module->getTitleOrPageId( $params );
                                    $namespace = $pageObj->getTitle()->getNamespace();
                        Severity: Minor
                        Found in repo/includes/RepoHooks.php - About 1 hr to fix

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

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

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

                                public function deserialize( string $siteId, array $serialization, string $basePath = '' ): SiteLink {
                                    if ( !array_key_exists( 'title', $serialization ) ) {
                                        throw new MissingFieldException( 'title', $basePath );
                                    }
                            
                            

                              Method handleDescriptionsValidationError has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function handleDescriptionsValidationError( ValidationError $validationError ): void {
                                      $context = $validationError->getContext();
                              
                                      switch ( $validationError->getCode() ) {
                                          case DescriptionsSyntaxValidator::CODE_DESCRIPTIONS_NOT_ASSOCIATIVE:

                                Method updateQueryBuilder has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function updateQueryBuilder( SelectQueryBuilder $queryBuilder, array $entityIds, IReadableDatabase $db ) {
                                        $where = [];
                                        $joinSlotsTable = false;
                                
                                        foreach ( $entityIds as $entityId ) {
                                Severity: Minor
                                Found in lib/includes/Store/Sql/PageTableEntityQueryBase.php - About 1 hr to fix

                                  Method newDefinitionsFromConfigArray has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function newDefinitionsFromConfigArray( array $sourceConfig, SubEntityTypesMapper $subEntityTypesMapper ) {
                                          $this->assertConfigArrayWellFormed( $sourceConfig );
                                  
                                          $sources = [];
                                  
                                  
                                  Severity: Minor
                                  Found in data-access/src/EntitySourceDefinitionsConfigParser.php - About 1 hr to fix

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

                                            EntityContentFactory $contentFactory,
                                            EntityTitleStoreLookup $entityTitleStoreLookup,
                                            IdGenerator $idGenerator,
                                            EntityIdComposer $entityIdComposer,
                                            RevisionStore $revisionStore,
                                    Severity: Major
                                    Found in repo/includes/Store/Sql/WikiPageEntityStore.php - About 1 hr to fix

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

                                              string $title,
                                              array $tags,
                                              ChangeOpFactoryProvider $changeOpFactoryProvider,
                                              SpecialPageCopyrightView $copyrightView,
                                              SummaryFormatter $summaryFormatter,
                                      Severity: Major
                                      Found in repo/includes/Specials/SpecialModifyTerm.php - About 1 hr to fix

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

                                                array $tags,
                                                SpecialPageCopyrightView $copyrightView,
                                                SummaryFormatter $summaryFormatter,
                                                EntityTitleLookup $entityTitleLookup,
                                                MediaWikiEditEntityFactory $editEntityFactory,
                                        Severity: Major
                                        Found in repo/includes/Specials/SpecialSetLabelDescriptionAliases.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language