Smile-SA/elasticsuite

View on GitHub

Showing 1,375 of 1,375 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (oRange === "max" && this.orientation === "horizontal") {
                    this.range[animate ? "animate" : "css"]({width: (100 - valPercent) + "%"}, {
                        queue: false,
                        duration: o.animate
                    });
src/module-elasticsuite-catalog/view/frontend/web/js/slider.js on lines 598..603

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                if (oRange === "max" && this.orientation === "vertical") {
                    this.range[animate ? "animate" : "css"]({height: (100 - valPercent) + "%"}, {
                        queue: false,
                        duration: o.animate
                    });
src/module-elasticsuite-catalog/view/frontend/web/js/slider.js on lines 589..594

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 74.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function drawLegendBox has 44 lines of code (exceeds 40 allowed). Consider refactoring.
Open

            const drawLegendBox = function(x, y, legendItem) {
                if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {
                    return;
                }
                ctx.save();
Severity: Minor
Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

    Function drawGrid has 44 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

            drawGrid(chartArea) {
                const me = this;
                const grid = me.options.grid;
                const ctx = me.ctx;
                const items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));
    Severity: Minor
    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

      Function lttbDecimation has 44 lines of code (exceeds 40 allowed). Consider refactoring.
      Open

          function lttbDecimation(data, start, count, availableWidth, options) {
              const samples = options.samples || availableWidth;
              if (samples >= count) {
                  return data.slice(start, start + count);
              }
      Severity: Minor
      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                AttributeCollectionFactory $attributeCollectionFactory,
                StoreManagerInterface $storeManager,
                IndexOperationInterface $indexManager,
                MappingHelper $mappingHelper,
        src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/CategoryUid.php on lines 104..122
        src/module-elasticsuite-core/Search/Request/Aggregation/Bucket/AbstractBucket.php on lines 82..100

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                ResourceConnection $resource,
                StoreManagerInterface $storeManager,
                MetadataPool $metadataPool,
                StockResolverInterface $stockResolver,
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php on lines 71..81
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php on lines 60..71

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                $name,
                $field,
                array $metrics = [],
                array $childBuckets = [],
        src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/CategoryUid.php on lines 104..122
        src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php on lines 96..114

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (!empty($subQuery) && $subQuery instanceof QueryInterface) {
                        if ($value === false) {
                            $subQuery = $this->queryFactory->create(QueryInterface::TYPE_NOT, ['query' => $subQuery]);
                        }
        
        
        src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Combine.php on lines 157..162

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 53.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    if ($subQuery !== null && $subQuery instanceof QueryInterface) {
                        if ($value === false) {
                            $subQuery = $this->queryFactory->create(QueryInterface::TYPE_NOT, ['query' => $subQuery]);
                        }
                        $queryParams[$queryClause][] = $subQuery;
        src/module-elasticsuite-virtual-category/Model/Rule/Condition/Combine.php on lines 50..56

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 53.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                ResourceConnection $resource,
                StoreManagerInterface $storeManager,
                MetadataPool $metadataPool,
                StockRegistryInterface $stockRegistry,
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/CategoryData.php on lines 71..81
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php on lines 59..70

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                ResourceConnection $resource,
                StoreManagerInterface $storeManager,
                MetadataPool $metadataPool,
                Config $eavConfig,
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/Deprecation/InventoryData.php on lines 60..71
        src/module-elasticsuite-catalog/Model/ResourceModel/Product/Indexer/Fulltext/Datasource/InventoryData.php on lines 59..70

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

            public function __construct(
                CategoryAttributeQuery $categoryAttributeQuery,
                CategoryAttributesMapper $categoryAttributesMapper,
                RootCategoryProvider $rootCategoryProvider,
                LayerFormatter $layerFormatter,
        src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/AttributeList.php on lines 96..114
        src/module-elasticsuite-core/Search/Request/Aggregation/Bucket/AbstractBucket.php on lines 82..100

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

                QueryInterface $searchQuery,
                FulltextCollectionFactory $productCollectionFactory,
                ItemDataFactory $previewItemFactory,
                QueryFactory $queryFactory,
                QueryBuilder $queryBuilder,
        Severity: Major
        Found in src/module-elasticsuite-catalog/Model/Search/Preview.php - About 1 hr to fix

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

                  \Magento\Framework\Model\Context $context,
                  \Magento\Framework\Registry $registry,
                  \Smile\ElasticsuiteCatalogRule\Model\RuleFactory  $ruleFactory,
                  \Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
                  \Magento\Framework\Serialize\SerializerInterface $serializer,
          Severity: Major
          Found in src/module-elasticsuite-catalog-optimizer/Model/Optimizer.php - About 1 hr to fix

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

                    Context $context,
                    Registry $registry,
                    FormFactory $formFactory,
                    Factory $configFactory,
                    Structure $configStructure,

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

                      RequestFactory $requestFactory,
                      DimensionFactory $dimensionFactory,
                      QueryBuilder $queryBuilder,
                      SortOrderBuilder $sortOrderBuilder,
                      AggregationBuilder $aggregationBuilder,
              Severity: Major
              Found in src/module-elasticsuite-core/Search/Request/Builder.php - About 1 hr to fix

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

                        $queryText,
                        array $fields,
                        $minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
                        $tieBreaker = self::DEFAULT_TIE_BREAKER,
                        $name = null,
                Severity: Major
                Found in src/module-elasticsuite-core/Search/Request/Query/MultiMatch.php - About 1 hr to fix

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

                          $name,
                          $primaryFieldName,
                          $requestFieldName,
                          \Magento\Search\Model\ResourceModel\Query\CollectionFactory $collectionFactory,
                          \Magento\Framework\Locale\FormatInterface $localeFormat,

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

                            CategoryInterface $category,
                            FulltextCollectionFactory $productCollectionFactory,
                            ItemDataFactory $previewItemFactory,
                            QueryFactory $queryFactory,
                            ContextInterface $searchContext,
                    Severity: Major
                    Found in src/module-elasticsuite-virtual-category/Model/Preview.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language