wikimedia/mediawiki-extensions-CirrusSearch

View on GitHub

Showing 718 of 718 total issues

Method build has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ClusterSettings $cluster,
        string $updateGroup,
        string $method,
        array $arguments,
        array $params = [],
Severity: Major
Found in includes/Job/ElasticaWrite.php - About 50 mins to fix

    Method onPageDeleteComplete has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function onPageDeleteComplete( ProperPageIdentity $page, Authority $deleter,
            string $reason, int $pageID, RevisionRecord $deletedRev, ManualLogEntry $logEntry,
            int $archivedRevisionCount
    Severity: Major
    Found in includes/ChangeListener.php - About 50 mins to fix

      Method onPageMoveComplete has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $old, $new, $user, $pageid, $redirid,
              $reason, $revision
      Severity: Major
      Found in includes/ChangeListener.php - About 50 mins to fix

        Method build has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function build( $fromPageId, $toPageId, $delay, $profile, $cluster, $loopId, \JobQueueGroup $jobQueueGroup ) {
        Severity: Major
        Found in includes/Job/CheckerJob.php - About 50 mins to fix

          Method sendUpdateWeightedTags has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  string $indexSuffix,
                  array $docIds,
                  string $tagField,
                  string $tagPrefix,
                  $tagNames = null,
          Severity: Major
          Found in includes/DataSender.php - About 50 mins to fix

            Method onPageMoveComplete has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function onPageMoveComplete( $old, $new, $user, $pageid, $redirid, $reason, $revision ) {
            Severity: Major
            Found in includes/PageChangeTracker.php - About 50 mins to fix

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

                      ConfigFactory $configFactory,
                      Config $mainConfig,
                      GlobalIdGenerator $globalIdGenerator,
                      TitleFormatter $titleFormatter,
                      PageLookup $pageLookup,
              Severity: Major
              Found in includes/Event/EventBusBridge.php - About 50 mins to fix

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

                        SearchQuery $query,
                        $index,
                        $queryTemplate,
                        $suggestionField,
                        array $queryParams,
                Severity: Major
                Found in includes/Fallbacks/IndexLookupFallbackMethod.php - About 50 mins to fix

                  Method createIndex has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $rebuild,
                          $maxShardsPerNode,
                          $shardCount,
                          $replicaCount,
                          $refreshInterval,
                  Severity: Major
                  Found in includes/Maintenance/IndexCreator.php - About 50 mins to fix

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

                            SearchConfig $searchConfig,
                            Connection $source,
                            Connection $target,
                            Index $index,
                            Index $oldIndex,
                    Severity: Major
                    Found in includes/Maintenance/Reindexer.php - About 50 mins to fix

                      Method onShowSearchHitTitle has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function onShowSearchHitTitle( &$title, &$text, $result, $terms, $page, &$query, &$attributes ) {
                      Severity: Major
                      Found in includes/Hooks.php - About 50 mins to fix

                        Method doApplyExtended has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix );
                        Severity: Major
                        Found in includes/Query/LegacyKeywordFeature.php - About 50 mins to fix

                          Method doApplyExtended has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  SearchContext $context,
                                  $key,
                                  $value,
                                  $quotedValue,
                                  $negated,
                          Severity: Major
                          Found in includes/Query/SimpleKeywordFeature.php - About 50 mins to fix

                            Method doApplyExtended has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix ) {
                            Severity: Major
                            Found in includes/Query/BaseRegexFeature.php - About 50 mins to fix

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

                                      Connection $connection,
                                      IReadableDatabase $db,
                                      RevisionStore $revStore,
                                      BacklinkCacheFactory $backlinkCacheFactory,
                                      DocumentSizeLimiter $docSizeLimiter,
                              Severity: Major
                              Found in includes/BuildDocument/BuildDocument.php - About 50 mins to fix

                                Method doApplyExtended has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated,
                                        $delimiter, $suffix
                                Severity: Major
                                Found in includes/Query/HasTemplateFeature.php - About 50 mins to fix

                                  Method onPageDeleteComplete has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function onPageDeleteComplete( ProperPageIdentity $page, Authority $deleter,
                                          string $reason, int $pageID, RevisionRecord $deletedRev, ManualLogEntry $logEntry,
                                          int $archivedRevisionCount
                                  Severity: Major
                                  Found in includes/ArchiveChangeListener.php - About 50 mins to fix

                                    Function decideClusters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        protected function decideClusters( string $updateGroup ) {
                                            $params = $this->getParams();
                                            $searchConfig = $this->getSearchConfig();
                                            $jobType = $this->getType();
                                    
                                    
                                    Severity: Minor
                                    Found in includes/Job/JobTraits.php - About 45 mins to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Method onPageSaveComplete has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public function onPageSaveComplete( $wikiPage, $user, $summary, $flags, $revisionRecord, $editResult ) {
                                    Severity: Minor
                                    Found in includes/PageChangeTracker.php - About 45 mins to fix

                                      Function pushElasticaWriteJobs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          protected function pushElasticaWriteJobs( string $updateGroup, array $items, $factory, int $batchSize = 10 ): void {
                                              // Elasticsearch has a queue capacity of 50 so if $documents contains 50 pages it could bump up
                                              // against the max.  So we chunk it and do them sequentially.
                                              $jobs = [];
                                              $config = $this->connection->getConfig();
                                      Severity: Minor
                                      Found in includes/Updater.php - About 45 mins to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language