Smile-SA/elasticsuite

View on GitHub

Showing 620 of 1,375 total issues

Method beforeResolve has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        ResolverInterface $subject,
        Field $field,
        $context,
        ResolveInfo $info,
        array $value = null,

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

            StoreManagerInterface $storeManager,
            CategoryRepositoryInterface $categoryRepository,
            Conditions $conditionsHelper,
            SkuPositionSortOrderBuilder $skuPositionSortOrderBuilder,
            Provider $filterProvider,

      Function aroundReindex has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function aroundReindex(\Magento\Catalog\Model\Category $category, \Closure $proceed)
          {
              $proceed();
      
              // Reindex only if attached product list has changed.

      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

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

              ScopeConfigInterface $scopeConfig,
              StoreManagerInterface $storeManager,
              CategoryCollectionFactory $categoryCollectionFactory,
              UrlFinderInterface $urlFinder,
              UrlInterface $urlBuilder,
      Severity: Minor
      Found in src/module-elasticsuite-virtual-category/Model/Url.php - About 45 mins to fix

        Function execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function execute($entity, $arguments = [])
            {
                $attributeData = $entity->getData(self::ATTRIBUTE_CODE);
        
                if (!is_object($attributeData)) {

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

            public function beforeGetImage(
                \Magento\Catalog\Block\Product\AbstractProduct $subject,
                \Magento\Catalog\Model\Product $product,
                $location,
                array $attributes = []
        Severity: Minor
        Found in src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php - About 45 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

        Consider simplifying this complex logical expression.
        Open

                        if ((this.options.values.length === 2 && this.options.range === true) &&
                            ((index === 0 && newVal > otherVal) || (index === 1 && newVal < otherVal))
                        ) {
                            newVal = otherVal;
                        }
        Severity: Major
        Found in src/module-elasticsuite-catalog/view/frontend/web/js/slider.js - About 40 mins to fix

          Function _measureText has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function _measureText(ctx, data, gc, longest, string) {
          Severity: Minor
          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

            Function _updateBezierControlPoints has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
            Severity: Minor
            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

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

                      ContainerConfigurationInterface $containerConfiguration,
                      ApplierList $applier,
                      $size,
                      $queryText = null,
                      $category = null

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

                        DbContext $context,
                        RuleFactory $ruleFactory,
                        SerializerInterface $serializer,
                        array $containerToLimitationDataMapping = [],
                        $connectionName = null

                  Function determineUnitForFormatting has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
                  Severity: Minor
                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

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

                            \Magento\Backend\Block\Context $context,
                            \Magento\Framework\Data\FormFactory $formFactory,
                            \Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory,
                            \Magento\Framework\Registry $registry,
                            array $data = []

                      Function getNearestItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function getNearestItems(chart, position, axis, intersect, useFinalPosition) {
                      Severity: Minor
                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                        Function lttbDecimation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function lttbDecimation(data, start, count, availableWidth, options) {
                        Severity: Minor
                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                          Function optimizedEvaluateItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              function optimizedEvaluateItems(chart, axis, position, handler, intersect) {
                          Severity: Minor
                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                            Function skip has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
                            Severity: Minor
                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                              Function determineLimits has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  function determineLimits(angle, pos, size, min, max) {
                              Severity: Minor
                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                Function _steppedLineTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    function _steppedLineTo(ctx, previous, target, flip, mode) {
                                Severity: Minor
                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                  Function _createResolver has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      function _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {
                                  Severity: Minor
                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language