Smile-SA/elasticsuite

View on GitHub

Showing 1,375 of 1,375 total issues

Function update has 58 lines of code (exceeds 40 allowed). Consider refactoring.
Open

        update(chart, width, height, minPadding) {
            if (!chart) {
                return;
            }
            const padding = toPadding(chart.options.layout.padding);
Severity: Major
Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

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

            $spellcheckRequestParams = [
                'index'           => $containerConfig->getIndexName(),
                'queryText'       => $queryText,
                'cutoffFrequency' => $containerConfig->getRelevanceConfig()->getCutOffFrequency(),
                'isUsingAllTokens'  => $containerConfig->getRelevanceConfig()->isUsingAllTokens(),
    src/module-elasticsuite-core/Search/Request/Builder.php on lines 239..246

    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 65.

    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

            $spellcheckRequestParams = [
                'index'           => $containerConfig->getIndexName(),
                'queryText'       => $queryText,
                'cutoffFrequency' => $containerConfig->getRelevanceConfig()->getCutOffFrequency(),
                'isUsingAllTokens'  => $containerConfig->getRelevanceConfig()->isUsingAllTokens(),
    Severity: Major
    Found in src/module-elasticsuite-core/Search/Request/Builder.php and 1 other location - About 1 hr to fix
    src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Preview/SearchQuery.php on lines 124..131

    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 65.

    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 keydown has 57 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

                keydown: function (event) {
                    var allowed, curVal, newVal, step,
                        index = $(event.target).data("ui-slider-handle-index");
    
                    switch (event.keyCode) {
    Severity: Major
    Found in src/module-elasticsuite-catalog/view/frontend/web/js/slider.js - About 1 hr to fix

      Function buildOrUpdateScales has 57 lines of code (exceeds 40 allowed). Consider refactoring.
      Open

              buildOrUpdateScales() {
                  const me = this;
                  const options = me.options;
                  const scaleOpts = options.scales;
                  const scales = me.scales;
      Severity: Major
      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

        Method postProcessResponse has 57 lines of code (exceeds 40 allowed). Consider refactoring.
        Open

            public function postProcessResponse($data)
            {
                $terms = array_keys($data);
        
                $storeId        = $this->context->getStoreId();

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

              public function __construct(
                  QueryResultFactory $queryResultFactory,
                  StoreManagerInterface $storeManager,
                  ClientInterface $client,
                  ContainerConfigurationFactory $containerConfigFactory,
          src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php on lines 77..89
          src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php on lines 66..78
          src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php on lines 69..81
          src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php on lines 65..77
          src/module-elasticsuite-virtual-category/Controller/Router.php on lines 73..85

          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 84.

          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(
                  \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,
          src/module-elasticsuite-catalog/Model/Product/Search/Position.php on lines 61..73
          src/module-elasticsuite-tracker/Plugin/QuotePlugin.php on lines 63..75

          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 84.

          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 6 locations. Consider refactoring.
          Open

              public function __construct(
                  AttributeCollectionFactory $attributeCollectionFactory,
                  FulltextCollectionFactory $fulltextCollectionFactory,
                  StoreManagerInterface $storeManager,
                  ContextInterface $searchContext,
          src/module-elasticsuite-core/Model/DataProvider/Suggestions.php on lines 76..88
          src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php on lines 66..78
          src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php on lines 69..81
          src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php on lines 65..77
          src/module-elasticsuite-virtual-category/Controller/Router.php on lines 73..85

          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 84.

          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 6 locations. Consider refactoring.
          Open

              public function __construct(
                  Initial $initialConfig,
                  Converter $converter,
                  ScopedFactory $collectionFactory,
                  Container $containerReader,
          src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php on lines 77..89
          src/module-elasticsuite-core/Model/DataProvider/Suggestions.php on lines 76..88
          src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php on lines 69..81
          src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php on lines 65..77
          src/module-elasticsuite-virtual-category/Controller/Router.php on lines 73..85

          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 84.

          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(
                  \Smile\ElasticsuiteTracker\Api\CustomerTrackingServiceInterface $service,
                  \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
                  \Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
                  \Magento\Framework\View\Layout\PageType\Config $pageTypeConfig,
          Severity: Major
          Found in src/module-elasticsuite-tracker/Plugin/QuotePlugin.php and 2 other locations - About 1 hr to fix
          src/module-elasticsuite-analytics/Model/Search/Usage/Terms/AggregationProvider.php on lines 61..73
          src/module-elasticsuite-catalog/Model/Product/Search/Position.php on lines 61..73

          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 84.

          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 6 locations. Consider refactoring.
          Open

              public function __construct(
                  Data $catalogSearchHelper,
                  CustomerTrackingServiceInterface $service,
                  CookieManagerInterface $cookieManager,
                  TrackerHelper $trackerHelper,
          src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php on lines 77..89
          src/module-elasticsuite-core/Model/DataProvider/Suggestions.php on lines 76..88
          src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php on lines 66..78
          src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php on lines 69..81
          src/module-elasticsuite-virtual-category/Controller/Router.php on lines 73..85

          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 84.

          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 6 locations. Consider refactoring.
          Open

              public function __construct(
                  ActionFactory $actionFactory,
                  ManagerInterface $eventManager,
                  StoreManagerInterface $storeManager,
                  Url $urlModel,
          src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php on lines 77..89
          src/module-elasticsuite-core/Model/DataProvider/Suggestions.php on lines 76..88
          src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php on lines 66..78
          src/module-elasticsuite-core/Search/Request/SortOrder/SortOrderBuilder.php on lines 69..81
          src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php on lines 65..77

          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 84.

          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 6 locations. Consider refactoring.
          Open

              public function __construct(
                  StandardFactory $standardOrderFactory,
                  NestedFactory $nestedOrderFactory,
                  QueryBuilder $queryBuilder,
                  ScriptFactory $scriptOrderFactory,
          src/module-elasticsuite-catalog/Plugin/Ui/Category/Form/DataProviderPlugin.php on lines 77..89
          src/module-elasticsuite-core/Model/DataProvider/Suggestions.php on lines 76..88
          src/module-elasticsuite-core/Model/Search/Request/RelevanceConfig/Reader/ContainerStore.php on lines 66..78
          src/module-elasticsuite-tracker/Observer/TrackRedirectIfOneResult.php on lines 65..77
          src/module-elasticsuite-virtual-category/Controller/Router.php on lines 73..85

          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 84.

          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(
                  \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Search\Position $resourceModel,
                  \Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
                  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
                  \Magento\Search\Model\ResourceModel\Query\Collection $queryCollection,
          src/module-elasticsuite-analytics/Model/Search/Usage/Terms/AggregationProvider.php on lines 61..73
          src/module-elasticsuite-tracker/Plugin/QuotePlugin.php on lines 63..75

          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 84.

          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 13 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  Context $context,
                  Data $backendData,
                  Config $config,
                  AttributeList $attributeList,
                  QueryBuilder $queryBuilder,

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

                    \Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory,
                    \Magento\Store\Model\StoreManagerInterface $storeManager,
                    \Magento\Catalog\Model\Layer $layer,
                    \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder,
                    \Magento\Catalog\Model\ResourceModel\Layer\Filter\Price $resource,
            Severity: Major
            Found in src/module-elasticsuite-catalog/Model/Layer/Filter/Price.php - About 1 hr to fix

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

                      $name,
                      $field,
                      array $metrics = [],
                      array $childBuckets = [],
                      array $pipelines = [],

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

                        $name,
                        $field,
                        array $metrics = [],
                        array $childBuckets = [],
                        array $pipelines = [],

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

                          array $fields,
                          $like,
                          $minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
                          $boostTerms = self::DEFAULT_BOOST_TERMS,
                          $minTermFreq = self::DEFAULT_MIN_TERM_FREQ,
                  Severity: Major
                  Found in src/module-elasticsuite-core/Search/Request/Query/MoreLikeThis.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language