Smile-SA/elasticsuite

View on GitHub

Showing 607 of 1,357 total issues

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

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

      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

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

                \Smile\ElasticsuiteTracker\Api\CustomerTrackingServiceInterface $service,
                \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
                \Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
                \Magento\Framework\View\Layout\PageType\Config $pageTypeConfig,
                \Psr\Log\LoggerInterface $logger
        Severity: Minor
        Found in src/module-elasticsuite-tracker/Plugin/QuotePlugin.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 __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    LayerFormatter $layerFormatter,
                    AttributeRepository $attributeRepository,
                    LayeredNavAttributesProvider $layeredNavAttributesProvider,
                    $hideNoValueAttributes = [],
                    $bucketNameFilter = []

              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

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

                    private function prepareAdaptiveIntervals(): array
                    {
                        $adaptiveIntervals = [];
                        $intervals = $this->getIntervals();
                
                
                Severity: Minor
                Found in src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.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

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

                    public function getElasticSuiteIndices(): ?array
                    {
                        if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) {
                            $elasticSuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices();
                            $excludedIndexStatus = [
                Severity: Minor
                Found in src/module-elasticsuite-indices/Block/Adminhtml/Analysis/Analyzer.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

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

                    public function getList()
                    {
                        if (null === $this->attributeList) {
                            $cacheKey       = self::CACHE_KEY;
                            $attributesList = $this->cache->load($cacheKey);

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

                    public function loadArray($arr, $key = 'conditions')
                    {
                        $aggregator = $this->getAggregatorFromArray($arr);
                        $value      = $this->getValueFromArray($arr);
                
                
                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

                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

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

                    public function loadChildrens($productIds, $storeId)
                    {
                        $children = [];
                
                        foreach ($this->catalogProductType->getCompositeTypes() as $productTypeId) {

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

                    public function afterGetSortOrders(
                        RequestMapper $subject,
                        $result,
                        ContainerConfigurationInterface $containerConfiguration,
                        SearchCriteriaInterface $searchCriteria
                Severity: Minor
                Found in src/module-elasticsuite-catalog/Plugin/Search/RequestMapperPlugin.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

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

                    private function canIndexAttribute(AttributeInterface $attribute)
                    {
                        // 'price' attribute is declared as nested field into the indices file.
                        $canIndex = $attribute->getBackendType() != 'static' && $attribute->getAttributeCode() !== 'price';
                
                

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

                    public function getValueElementType()
                    {
                        $valueElementType = 'text';
                
                        if ($this->getAttribute() == 'attribute_set_id') {
                Severity: Minor
                Found in src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product.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

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

                    public function getSearchQuery(ProductCondition $condition)
                    {
                        // Retrieve the operator and days from the condition.
                        $operator = $condition->getOperator();
                        $value = (int) $condition->getValue();

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

                    protected function _prepareValueOptions()
                    {
                        $selectReady = $this->getData('value_select_options');
                        $hashedReady = $this->getData('value_option');
                
                
                Severity: Minor
                Found in src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product.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

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

                    public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
                    {
                        $type        = $attribute->getBackendType();
                        $aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation;
                
                

                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