Smile-SA/elasticsuite

View on GitHub

Showing 620 of 1,375 total issues

Method __construct has 14 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\Framework\Escaper $escaper,

    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

      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();

            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

                      Function aroundGetData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function aroundGetData(CategoryDataProvider $dataProvider, \Closure $proceed)
                          {
                              $data = $proceed();
                      
                              $currentCategory = $dataProvider->getCurrentCategory();

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

                          private function updateAttributeData($attribute, $rowData)
                          {
                              $dataChanged = false;
                      
                              foreach ($rowData as $key => $value) {
                      Severity: Minor
                      Found in src/module-elasticsuite-catalog/Model/Import/ProductAttribute.php - About 1 hr 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 getAllDefaultLanguageStemmers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function getAllDefaultLanguageStemmers(\DOMXPath $xpath)
                          {
                              $defaultStemmers = [];
                      
                              $filterPath = "@type='stemmer' and @name='stemmer'";
                      Severity: Minor
                      Found in src/module-elasticsuite-core/Index/Analysis/Config/Converter.php - About 1 hr 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 prepareFieldCondition has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function prepareFieldCondition(FieldInterface $field, $condition, $currentPath)
                          {
                              $queryType = QueryInterface::TYPE_TERMS;
                              $condition = $this->prepareCondition($condition);
                      
                      

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

                          public function buildSordOrders(ContainerConfigurationInterface $containerConfig, array $orders)
                          {
                              $sortOrders = [];
                              $mapping    = $containerConfig->getMapping();
                      
                      

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

                          public function create(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost = 1, $depth = 0)
                          {
                              $query = null;
                      
                              $fuzzySpellingTypes = [SpellcheckerInterface::SPELLING_TYPE_FUZZY, SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY];

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

                          protected function processNestedGroups($group)
                          {
                              $data = [];
                      
                              if (isset($group['fields']) && is_array($group['fields'])) {

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

                          private function saveTermsRelation(\Magento\Framework\Model\AbstractModel $object)
                          {
                              $termRelations = $object->getTermsRelations() ?? [];
                              $termRelations = array_filter($termRelations);
                      
                      
                      Severity: Minor
                      Found in src/module-elasticsuite-thesaurus/Model/ResourceModel/Thesaurus.php - About 1 hr 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 getFilterArray has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function getFilterArray(array $request, \Magento\Catalog\Model\Product $product)
                          {
                              $filterArray = [];
                              $attributes = $this->eavConfig->getEntityAttributes(\Magento\Catalog\Model\Product::ENTITY, $product);
                      
                      
                      Severity: Minor
                      Found in src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php - About 1 hr 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 _calculateBarValuePixels has 54 lines of code (exceeds 40 allowed). Consider refactoring.
                      Open

                              _calculateBarValuePixels(index) {
                                  const me = this;
                                  const {vScale, _stacked} = me._cachedMeta;
                                  const {base: baseValue, minBarLength} = me.options;
                                  const parsed = me.getParsed(index);
                      Severity: Major
                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language