wikimedia/mediawiki-extensions-CirrusSearch

View on GitHub

Showing 718 of 718 total issues

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

    public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector );
Severity: Minor
Found in includes/Query/KeywordFeature.php - About 45 mins to fix

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

        public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
    Severity: Minor
    Found in includes/Query/PrefixFeature.php - About 45 mins to fix

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

          public static function looksLikeAutomation( SearchConfig $config, string $ip, array $headers ): bool {
              // Is there an http header that can be matched with regex to flag automation,
              // such as the user-agent or a flag applied by some infrastructure?
              $automationHeaders = $config->get( 'CirrusSearchAutomationHeaderRegexes' ) ?? [];
              foreach ( $automationHeaders as $name => $pattern ) {
      Severity: Minor
      Found in includes/Util.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 buildSuggestion has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function buildSuggestion( $suggestionType, $docId, array $inputs, $score, array $inputDoc, array $scoreExplanation = null ) {
      Severity: Minor
      Found in includes/BuildDocument/Completion/SuggestBuilder.php - About 45 mins to fix

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

            public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
        Severity: Minor
        Found in includes/Query/HasTemplateFeature.php - About 45 mins to fix

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

                  \CirrusSearch\Parser\KeywordRegistry $keywordRegistry,
                  Escaper $escaper,
                  $qmarkStripLevel,
                  ParsedQueryClassifiersRepository $classifierRepository,
                  NamespacePrefixParser $namespacePrefixParser,
          Severity: Minor
          Found in includes/Parser/QueryStringRegex/QueryStringRegexParser.php - About 45 mins to fix

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

                public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
            Severity: Minor
            Found in includes/Query/BoostTemplatesFeature.php - About 45 mins to fix

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

                  public function getFixablePart() {
                      if ( !$this->visited ) {
                          $this->visited = true;
                          $this->parsedQuery->getRoot()->accept( $this );
                      }
              Severity: Minor
              Found in includes/Parser/AST/Visitor/QueryFixer.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 extractDisplayTitle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private static function extractDisplayTitle( Title $title, ParserOutput $output ): ?string {
                      $titleText = $title->getText();
                      $titlePrefixedText = $title->getPrefixedText();
              
                      $raw = $output->getDisplayTitle();
              Severity: Minor
              Found in includes/BuildDocument/ParserOutputPageProperties.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 parseValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
              Severity: Minor
              Found in includes/Query/BaseRegexFeature.php - About 45 mins to fix

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

                        $key,
                        $value,
                        $quotedValue,
                        $valueDelimiter,
                        $suffix,
                Severity: Minor
                Found in includes/Query/SimpleKeywordFeature.php - About 45 mins to fix

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

                      public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
                  Severity: Minor
                  Found in includes/Query/PreferRecentFeature.php - About 45 mins to fix

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

                        public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
                    Severity: Minor
                    Found in includes/Query/LanguageFeature.php - About 45 mins to fix

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

                          public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
                              // en:Programming|id:3041512\
                              $categories = explode( '|', $value );// en:programming
                              if ( count( $categories ) > $this->maxConditions ) {
                                  $warningCollector->addWarning(
                      Severity: Minor
                      Found in includes/Query/InCategoryFeature.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 setIfDefined has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              array $sourceArray,
                              $sourceKey,
                              array &$destArray,
                              $destKey = null,
                              $mapFn = null,
                      Severity: Minor
                      Found in includes/Util.php - About 45 mins to fix

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

                            public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
                        Severity: Minor
                        Found in includes/Query/InCategoryFeature.php - About 45 mins to fix

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

                              public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
                          Severity: Minor
                          Found in includes/Query/SubPageOfFeature.php - About 45 mins to fix

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

                                public static function processSearchRawReturn( $result, WebRequest $request,
                                                                               CirrusDebugOptions $debugOptions ) {
                                    $output = null;
                                    $header = null;
                                    if ( $debugOptions->getCirrusExplainFormat() !== null ) {
                            Severity: Minor
                            Found in includes/Util.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 finishInitializeBatch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function finishInitializeBatch(): void {
                                    if ( !$this->linkCountClosures ) {
                                        return;
                                    }
                                    $linkCountClosureCount = count( $this->linkCountClosures );
                            Severity: Minor
                            Found in includes/BuildDocument/RedirectsAndIncomingLinks.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 parseValue has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector
                            Severity: Minor
                            Found in includes/Query/ArticleTopicFeature.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language