wikimedia/mediawiki-extensions-CirrusSearch

View on GitHub

Showing 691 of 718 total issues

Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
Severity: Minor
Found in includes/Query/SubPageOfFeature.php - About 35 mins to fix

    Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
    Severity: Minor
    Found in includes/Query/LinksToFeature.php - About 35 mins to fix

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

          public function build( array $inputDoc, $suggestType, $score, \Elastica\Document $suggestDoc, $targetNamespace ) {
      Severity: Minor
      Found in includes/BuildDocument/Completion/DefaultSortSuggestionsBuilder.php - About 35 mins to fix

        Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
        Severity: Minor
        Found in includes/Query/MoreLikeThisFeature.php - About 35 mins to fix

          Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
          Severity: Minor
          Found in includes/Query/ArticleTopicFeature.php - About 35 mins to fix

            Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                abstract protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated );
            Severity: Minor
            Found in includes/Query/SimpleKeywordFeature.php - About 35 mins to fix

              Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
              Severity: Minor
              Found in includes/Query/BoostTemplatesFeature.php - About 35 mins to fix

                Method buildRedirectsSuggestion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

                      public function __construct( $start, $end, $phrase, $slop, $stem ) {
                  Severity: Minor
                  Found in includes/Parser/AST/PhraseQueryNode.php - About 35 mins to fix

                    Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
                    Severity: Minor
                    Found in includes/Query/InCategoryFeature.php - About 35 mins to fix

                      Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
                      Severity: Minor
                      Found in includes/Query/HasTemplateFeature.php - About 35 mins to fix

                        Method truncateField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private function truncateField( string $field, bool $keyword, int $minFieldLength, int $maxDocSize, string $statBucket ): void {
                        Severity: Minor
                        Found in includes/BuildDocument/DocumentSizeLimiter.php - About 35 mins to fix

                          Method buildTitleSuggestion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

                            Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
                            Severity: Minor
                            Found in includes/Query/LanguageFeature.php - About 35 mins to fix

                              Method overrideNumeric has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public static function overrideNumeric( &$dest, $request, $name, $limit = null, $upperLimit = true ) {
                              Severity: Minor
                              Found in includes/Util.php - About 35 mins to fix

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

                                    public function build( array $inputDoc, $suggestType, $score, \Elastica\Document $suggestDoc, $targetNamespace ) {
                                Severity: Minor
                                Found in includes/BuildDocument/Completion/NaiveSubphrasesSuggestionsBuilder.php - About 35 mins to fix

                                  Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
                                  Severity: Minor
                                  Found in includes/Query/MoreLikeFeature.php - About 35 mins to fix

                                    Method doApply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        protected function doApply( SearchContext $context, $key, $value, $quotedValue, $negated ) {
                                    Severity: Minor
                                    Found in includes/Query/TextFieldFilterFeature.php - About 35 mins to fix

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

                                              $name,
                                              $type,
                                              string $indexAnalyzer,
                                              string $searchAnalyzer,
                                              string $similarity
                                      Severity: Minor
                                      Found in includes/Wikimedia/WeightedTags.php - About 35 mins to fix

                                        Function formatMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            protected static function formatMessage( array $error ) {
                                                if ( isset( $error['actionReasons'] ) ) {
                                                    $message = $error['type'] . ': ' . $error['reason'];
                                                    foreach ( $error['actionReasons'] as $actionReason ) {
                                                        $message .= "  - $actionReason\n";
                                        Severity: Minor
                                        Found in includes/ElasticaErrorHandler.php - About 35 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