wikimedia/mediawiki-extensions-CirrusSearch

View on GitHub

Showing 691 of 718 total issues

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

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

                                private function getRevisionIDs(): array {
                                    $result = [];
                                    $warning = false;
                                    foreach ( $this->getPageSet()->getRevisionIDs() as $revId => $pageId ) {
                                        if ( isset( $result[$pageId] ) ) {
                            Severity: Minor
                            Found in includes/Api/QueryBuildDocument.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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    InterwikiResolver $resolver, SearchConfig $hostWikiConfig, BagOStuff $localServerCache,
                                    CirrusSearchHookRunner $cirrusSearchHookRunner, UserOptionsLookup $userOptionsLookup,
                                    ExtensionRegistry $extensionRegistry
                            Severity: Minor
                            Found in includes/Profile/SearchProfileServiceFactory.php - About 45 mins to fix

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

                                      SearchConfig $config,
                                      array $namespaces = null,
                                      CirrusDebugOptions $options = null,
                                      FallbackRunner $fallbackRunner = null,
                                      FetchPhaseConfigBuilder $fetchPhaseConfigBuilder = null,
                              Severity: Minor
                              Found in includes/Search/SearchContext.php - About 45 mins to fix

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

                                        SearchConfig $config,
                                        $name,
                                        $target,
                                        $pattern,
                                        $caseInsensitive,
                                Severity: Minor
                                Found in includes/Search/Fetch/ExperimentalHighlightedFieldBuilder.php - About 45 mins to fix

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

                                      public function toArray() {
                                          $output = [
                                              'type' => $this->highlighterType
                                          ];
                                  
                                  
                                  Severity: Minor
                                  Found in includes/Search/Fetch/BaseHighlightedField.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