Smile-SA/elasticsuite

View on GitHub

Showing 607 of 1,357 total issues

File form-mini.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
 * versions in the future.
Severity: Minor
Found in src/module-elasticsuite-core/view/frontend/web/js/form-mini.js - About 2 hrs to fix

    Collection has 15 functions (exceeds 10 allowed). Consider refactoring.
    Open

    class Collection extends \Magento\Catalog\Model\ResourceModel\Category\Collection
    {
        /**
         * @var \Smile\ElasticsuiteCore\Search\Request\Builder
         */

      IndexOperation has 15 functions (exceeds 10 allowed). Consider refactoring.
      Open

      class IndexOperation implements IndexOperationInterface
      {
          /**
           * @var \Magento\Framework\ObjectManagerInterface
           */
      Severity: Minor
      Found in src/module-elasticsuite-core/Index/IndexOperation.php - About 2 hrs to fix

        File tracking.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* global document: true */
        /* global window: true */
        /* global console: true */
        /* exported smileTracker */
        
        
        Severity: Minor
        Found in src/module-elasticsuite-tracker/view/frontend/web/js/tracking.js - About 2 hrs to fix

          Function generateTicks$1 has 82 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

              function generateTicks$1(generationOptions, dataRange) {
                  const ticks = [];
                  const MIN_SPACING = 1e-14;
                  const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;
                  const unit = step || 1;
          Severity: Major
          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 2 hrs to fix

            Slider has 14 functions (exceeds 10 allowed). Consider refactoring.
            Open

            class Slider extends AbstractRenderer
            {
                /**
                 * The Data role, used for Javascript mapping of slider Widget
                 *
            Severity: Minor
            Found in src/module-elasticsuite-catalog/Block/Navigation/Renderer/Slider.php - About 2 hrs to fix

              ClientConfiguration has 14 functions (exceeds 10 allowed). Consider refactoring.
              Open

              class ClientConfiguration implements ClientConfigurationInterface
              {
                  /**
                   * Location of Elasticsearch client configuration.
                   *
              Severity: Minor
              Found in src/module-elasticsuite-core/Client/ClientConfiguration.php - About 2 hrs to fix

                Function _onPropertyChange has 80 lines of code (exceeds 40 allowed). Consider refactoring.
                Open

                        _onPropertyChange: _.debounce(function () {
                            var searchField = this.element,
                                clonePosition = {
                                    position: 'absolute',
                                    // Removed to fix display issues
                Severity: Major
                Found in src/module-elasticsuite-core/view/frontend/web/js/form-mini.js - About 2 hrs to fix

                  Function modifyAggregations has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)
                      {
                          if ($this->sliderHelper->isAdaptiveSliderEnabled()) {
                              foreach ($this->applicableAttributes as $attribute) {
                                  $field = $this->requestFieldMapper->getMappedFieldName($attribute->getAttributeCode());

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

                      public function buildAggregations(array $buckets = [])
                      {
                          $aggregations = [];
                  
                          foreach ($buckets as $bucket) {

                  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

                  ContainerConfiguration has 13 functions (exceeds 10 allowed). Consider refactoring.
                  Open

                  class ContainerConfiguration implements ContainerConfigurationInterface
                  {
                      /**
                       * @var string
                       */

                    Mapping has 13 functions (exceeds 10 allowed). Consider refactoring.
                    Open

                    class Mapping implements MappingInterface
                    {
                        /**
                         * @var string
                         */
                    Severity: Minor
                    Found in src/module-elasticsuite-core/Index/Mapping.php - About 2 hrs to fix

                      Collection has 13 functions (exceeds 10 allowed). Consider refactoring.
                      Open

                      class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
                      {
                          /**
                           * Store for filter
                           *

                        Url has 13 functions (exceeds 10 allowed). Consider refactoring.
                        Open

                        class Url
                        {
                            /**
                             * XML path for product url suffix
                             */
                        Severity: Minor
                        Found in src/module-elasticsuite-virtual-category/Model/Url.php - About 2 hrs to fix

                          Function getSubtreeBreadcrumbPath has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function getSubtreeBreadcrumbPath($helper, $appliedRoot)
                              {
                                  if (!$this->categoryPath) {
                                      $path     = [];
                                      $category = $helper->getCategory();

                          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

                          Preview has 12 functions (exceeds 10 allowed). Consider refactoring.
                          Open

                          class Preview extends Action
                          {
                              /**
                               * @var \Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\PreviewFactory
                               */

                            Product has 12 functions (exceeds 10 allowed). Consider refactoring.
                            Open

                            class Product extends \Magento\Rule\Model\Condition\Product\AbstractProduct
                            {
                                /**
                                 * @var AttributeList
                                 */
                            Severity: Minor
                            Found in src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product.php - About 2 hrs to fix

                              Condition has 12 functions (exceeds 10 allowed). Consider refactoring.
                              Open

                              class Condition extends AbstractSimpleObject implements ConditionInterface
                              {
                                  const KEY_CONDITION_TYPE = 'condition_type';
                                  const KEY_CONDITIONS = 'conditions';
                                  const KEY_AGGREGATOR_TYPE = 'aggregator_type';
                              Severity: Minor
                              Found in src/module-elasticsuite-catalog-rule/Model/Data/Condition.php - About 2 hrs to fix

                                MultiMatch has 12 functions (exceeds 10 allowed). Consider refactoring.
                                Open

                                class MultiMatch implements QueryInterface
                                {
                                    /**
                                     * @var string
                                     */
                                Severity: Minor
                                Found in src/module-elasticsuite-core/Search/Request/Query/MultiMatch.php - About 2 hrs to fix

                                  Config has 12 functions (exceeds 10 allowed). Consider refactoring.
                                  Open

                                  class Config extends \Magento\Framework\View\Element\Template
                                  {
                                      /**
                                       * The default tracking consent script, used as a fallback if none defined in layout.
                                       */
                                  Severity: Minor
                                  Found in src/module-elasticsuite-tracker/Block/Config.php - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language