Smile-SA/elasticsuite

View on GitHub

Showing 620 of 1,375 total issues

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

        Template\Context $context,
        Data $jsonHelper,
        TrackerHelper $trackerHelper,
        Registry $registry,
        array $data = []
Severity: Minor
Found in src/module-elasticsuite-tracker/Block/Variables/Page/AbstractBlock.php - About 35 mins to fix

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

            \Magento\Backend\Block\Template\Context $context,
            \Smile\ElasticsuiteAnalytics\Model\Report\Context $reportContext,
            \Smile\ElasticsuiteTracker\Model\IndexManager $indexManager,
            \Magento\Framework\Serialize\Serializer\Json $jsonSerializer,
            array $data = []

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

              \Smile\ElasticsuiteCore\Search\Request\Aggregation\AggregationFactory $aggregationFactory,
              \Smile\ElasticsuiteCore\Search\Request\Aggregation\MetricFactory $metricFactory,
              \Smile\ElasticsuiteCore\Search\Request\Aggregation\PipelineFactory $pipelineFactory,
              \Smile\ElasticsuiteCore\Search\Request\Query\QueryFactory $queryFactory,
              \Smile\ElasticsuiteAnalytics\Helper\Data $helper

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

                \Magento\Backend\App\Action\Context $context,
                PageFactory $resultPageFactory,
                \Magento\Framework\Registry $coreRegistry,
                ThesaurusRepositoryInterface $thesaurusRepository,
                ThesaurusFactory $thesaurusFactory

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

                  \Magento\Backend\Block\Context $context,
                  \Magento\Framework\Data\FormFactory $formFactory,
                  \Magento\Framework\Registry $registry,
                  ReadHandler $readHandler,
                  array $data = []

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

                public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
            Severity: Minor
            Found in src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products.php - About 35 mins to fix

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

                      FileResolverInterface $fileResolver,
                      ConverterInterface $converter,
                      SchemaLocator $schemaLocator,
                      DomFactory $domFactory,
                      $fileName = self::FILE_NAME

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

                    public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)

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

                          \Smile\ElasticsuiteCore\Search\Request\Builder $searchRequestBuilder,
                          Context $context,
                          array $aggregationProviders = [],
                          array $queryProviders = [],
                          $containerName = 'tracking_log_event'
                  Severity: Minor
                  Found in src/module-elasticsuite-analytics/Model/Report/SearchRequestBuilder.php - About 35 mins to fix

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

                            \Magento\Framework\View\Element\Template\Context $context,
                            \Magento\Framework\Json\Helper\Data $jsonHelper,
                            \Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
                            \Magento\Framework\Registry $registry,
                            array $data = []
                    Severity: Minor
                    Found in src/module-elasticsuite-tracker/Block/Variables/AbstractBlock.php - About 35 mins to fix

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

                              DataCheckResultFactory $checkResultFactory,
                              Builder $searchRequestBuilder,
                              QueryFactory $queryFactory,
                              SearchEngineInterface $searchEngine,
                              ?DataFixerInterface $dataFixer = null

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

                            public function aroundLoad(FlatResource $categoryResource, \Closure $proceed, $category, $value, $field = null)

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

                                  Data $catalogSearchHelper,
                                  CustomerTrackingServiceInterface $service,
                                  CookieManagerInterface $cookieManager,
                                  TrackerHelper $trackerHelper,
                                  PageTypeConfig $pageTypeConfig
                          Severity: Minor
                          Found in src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php - About 35 mins to fix

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

                                    Context $layerContext,
                                    Resolver $layerResolver,
                                    FilterableAttributesListFactory $filterableAttributesListFactory,
                                    FilterListFactory $filterListFactory,
                                    $filtersList = []

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

                                      ActionFactory $actionFactory,
                                      ManagerInterface $eventManager,
                                      StoreManagerInterface $storeManager,
                                      Url $urlModel,
                                      VirtualCategoryRoot $virtualCategoryRoot
                              Severity: Minor
                              Found in src/module-elasticsuite-virtual-category/Controller/Router.php - About 35 mins to fix

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

                                        Field $field,
                                        $context,
                                        ResolveInfo $info,
                                        array $value = null,
                                        array $args = null
                                Severity: Minor
                                Found in src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Aggregations.php - About 35 mins to fix

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

                                          \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
                                          FullIndexer $fullIndexer,
                                          \Smile\ElasticsuiteVirtualCategory\Model\ResourceModel\Category\Product\Position $saveHandler,
                                          \Magento\Framework\Json\Helper\Data $jsonHelper,
                                          \Magento\Framework\Message\ManagerInterface $messageManager

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

                                        private function combineSynonyms($queryText, $synonymByPositions, $maxRewrites, $substitutions = 0, $offset = 0)
                                    Severity: Minor
                                    Found in src/module-elasticsuite-thesaurus/Model/Index.php - About 35 mins to fix

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

                                          private function updateSearchContext($storeId, $category, $queryText)
                                          {
                                              $this->searchContext->setStoreId($storeId);
                                      
                                              if ((string) $queryText !== '') {

                                      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 getSearchQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function getSearchQuery()
                                          {
                                              $queryParams = [];
                                      
                                              $aggregator = $this->getAggregator();
                                      Severity: Minor
                                      Found in src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.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