wikimedia/mediawiki-extensions-CirrusSearch

View on GitHub

Showing 691 of 718 total issues

Avoid too many return statements within this method.
Open

            return false;
Severity: Major
Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return false;
    Severity: Major
    Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return true;
      Severity: Major
      Found in maintenance/UpdateOneSearchIndexConfig.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return null;
        Severity: Major
        Found in maintenance/ForceSearchIndex.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $page;
          Severity: Major
          Found in maintenance/ForceSearchIndex.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return Status::newGood( $result );
            Severity: Major
            Found in maintenance/RunSearch.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return false;
              Severity: Major
              Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return "Index on wrong cluster of replica, expected in " + ', '.join(
                Severity: Major
                Found in scripts/check_indices.py - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $mresponses->transformAndGetMulti( $this->searchContext->getResultsType(), array_keys( $iwQueries ),
                              static function ( array $v ) use ( $blockScorer ) {
                                  return $blockScorer->reorder( $v );
                              } );
                  Severity: Major
                  Found in includes/InterwikiSearcher.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return false;
                    Severity: Major
                    Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return (
                      Severity: Major
                      Found in scripts/check_indices.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return (
                        Severity: Major
                        Found in scripts/check_indices.py - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return true;
                          Severity: Major
                          Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                return $result;
                            Severity: Major
                            Found in maintenance/RunSearch.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return false;
                              Severity: Major
                              Found in maintenance/UpdateSuggesterIndex.php - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return 'Duplicate of live index ' + live_index + '. ' + reason
                                Severity: Major
                                Found in scripts/check_indices.py - About 30 mins to fix

                                  Function getExtraIndexesForNamespaces has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static function getExtraIndexesForNamespaces( SearchConfig $config, array $namespaces ) {
                                          $extraIndexes = [];
                                          foreach ( $config->get( 'CirrusSearchExtraIndexes' ) ?: [] as $namespace => $indexes ) {
                                              if ( !in_array( $namespace, $namespaces ) ) {
                                                  continue;
                                  Severity: Minor
                                  Found in includes/OtherIndexesUpdater.php - About 25 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 hasProfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function hasProfile( $type, $name ) {
                                          if ( isset( $this->repositories[$type] ) ) {
                                              foreach ( $this->repositories[$type] as $repo ) {
                                                  if ( $repo->hasProfile( $name ) ) {
                                                      return true;
                                  Severity: Minor
                                  Found in includes/Profile/SearchProfileService.php - About 25 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 loadInterwikiOverrides has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private function loadInterwikiOverrides( SearchProfileService $service, SearchConfig $config ) {
                                          if ( $config->isLocalWiki() || $config === $this->hostWikiConfig ) {
                                              return;
                                          }
                                          $iwPrefix = $this->interwikiResolver->getInterwikiPrefix( $config->getWikiId() );
                                  Severity: Minor
                                  Found in includes/Profile/SearchProfileServiceFactory.php - About 25 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 newHighlightField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function newHighlightField(
                                          $name,
                                          $target,
                                          $priority = HighlightedField::DEFAULT_TARGET_PRIORITY
                                      ): BaseHighlightedField {
                                  Severity: Minor
                                  Found in includes/Search/Fetch/FetchPhaseConfigBuilder.php - About 25 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