Smile-SA/elasticsuite

View on GitHub

Showing 607 of 1,357 total issues

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

        StoreManagerInterface $storeManager,
        Manager $moduleManager,
        FieldIterator $childrenIterator,
        Factory $cloneModelFactory,
        Mapper $dependencyMapper,

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

            $queryText,
            $field,
            $cutoffFrequency = self::DEFAULT_CUTOFF_FREQUENCY,
            $minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
            $name = null,
    Severity: Minor
    Found in src/module-elasticsuite-core/Search/Request/Query/Common.php - About 45 mins to fix

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

          private function getFieldAnalyzers(): array
          {
              $analyzers = [];
      
              // By default, texts are indexed with "keyword" analyzer which is a 'noop' analyzer.
      Severity: Minor
      Found in src/module-elasticsuite-core/Index/Mapping/Field.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

              \Smile\ElasticsuiteCore\Search\Request\Builder $searchRequestBuilder,
              \Magento\Store\Model\StoreManagerInterface $storeManager,
              \Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfigurationInterfaceFactory $containerConfigFactory,
              \Smile\ElasticsuiteCore\Api\Search\ContextInterface $searchContext,
              \Magento\Search\Model\QueryFactory $queryFactory,
      Severity: Minor
      Found in src/module-elasticsuite-core/Model/Search/RequestBuilder.php - About 45 mins to fix

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

            public function build(array $options = []): \OpenSearch\Client
            {
                $options       = array_merge($this->defaultOptions, $options);
        
                $clientBuilder = $this->clientBuilder->create();
        Severity: Minor
        Found in src/module-elasticsuite-core/Client/ClientBuilder.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

                string $queryText,
                int $kValue,
                string $field = self::DEFAULT_EMBEDDING_FIELD,
                ?string $name = null,
                float $boost = QueryInterface::DEFAULT_BOOST_VALUE,

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

              public function getAnalysisSettings($store)
              {
                  $language = $this->helper->getLanguageCode($store);
                  $settings = $this->analysisConfig->get($language);
          
          
          Severity: Minor
          Found in src/module-elasticsuite-core/Index/IndexSettings.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

                  $index,
                  $queryText,
                  $cutoffFrequency,
                  $isUsingAllTokens,
                  $isUsingReference,
          Severity: Minor
          Found in src/module-elasticsuite-core/Search/Spellchecker/Request.php - About 45 mins to fix

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

                private function initScope()
                {
                    if ($this->getSection() === null) {
                        $this->setSection('');
                    }
            Severity: Minor
            Found in src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig.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 getIndexOptionText has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getIndexOptionText($attributeId, $storeId, $optionId)
                {
                    $attribute = $this->getAttributeByStore($attributeId, $storeId);
            
                    if (!isset($this->attributeOptionTextCache[$storeId]) || !isset($this->attributeOptionTextCache[$storeId][$attributeId])) {
            Severity: Minor
            Found in src/module-elasticsuite-catalog/Helper/AbstractAttribute.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 parseAnalyzers has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    \DOMXPath $xpath,
                    array $availableCharFilters,
                    array $availableFilters,
                    $language = self::LANGUAGE_DEFAULT,
                    $typeRootNode = self::ANALYZER_TYPE_ROOT_NODE,
            Severity: Minor
            Found in src/module-elasticsuite-core/Index/Analysis/Config/Converter.php - About 45 mins to fix

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

                      \Magento\Framework\ObjectManagerInterface $objectManager,
                      \Smile\ElasticsuiteCore\Api\Client\ClientInterface $client,
                      \Smile\ElasticsuiteCore\Api\Client\ClientConfigurationInterface $clientConfiguration,
                      \Smile\ElasticsuiteCore\Api\Index\IndexSettingsInterface $indexSettings,
                      PipelineManagerInterface $pipelineManager,
              Severity: Minor
              Found in src/module-elasticsuite-core/Index/AsyncIndexOperation.php - About 45 mins to fix

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

                        \Magento\Framework\Search\Request\QueryInterface $query,
                        $functions = [],
                        $name = null,
                        $scoreMode = self::SCORE_MODE_SUM,
                        $boostMode = self::BOOST_MODE_SUM,
                Severity: Minor
                Found in src/module-elasticsuite-core/Search/Request/Query/FunctionScore.php - About 45 mins to fix

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

                      public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)

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

                        public function aroundCreate(
                            QueryBuilder $subject,
                            \Closure $proceed,
                            ContainerConfigurationInterface $containerConfig,
                            $queryText,
                    Severity: Minor
                    Found in src/module-elasticsuite-thesaurus/Plugin/QueryRewrite.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

                            JsonHelper $jsonHelper,
                            ImportHelper $importExportData,
                            Data $importData,
                            Helper $resourceHelper,
                            ProcessingErrorAggregatorInterface $errorAggregator,
                    Severity: Minor
                    Found in src/module-elasticsuite-thesaurus/Model/Import/Thesaurus.php - About 45 mins to fix

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

                          public function afterAddProduct(
                              Quote $subject,
                              $result
                          ) {
                              if (!$this->trackerHelper->isHeadlessMode()) {
                      Severity: Minor
                      Found in src/module-elasticsuite-tracker/Plugin/QuotePlugin.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function execute($entity, $arguments = [])
                          {
                              $attributeData = $entity->getData(self::ATTRIBUTE_CODE);
                      
                              if (!is_object($attributeData)) {

                      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

                              Context $context,
                              Registry $registry,
                              FormFactory $formFactory,
                              Store $systemStore,
                              Yesno $booleanSource,

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

                                \Smile\ElasticsuiteCore\Api\Search\ContextInterface $contextInterface,
                                \Smile\ElasticsuiteVirtualCategory\Helper\Rule $helper,
                                \Magento\Store\Model\StoreManagerInterface $storeManager,
                                \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
                                \Smile\ElasticsuiteVirtualCategory\Model\VirtualCategory\Root $virtualCategoryRoot,
                          Severity
                          Category
                          Status
                          Source
                          Language