Smile-SA/elasticsuite

View on GitHub

Showing 1,375 of 1,375 total issues

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

        if (!empty($rows)) {
            $result = (bool) $this->getConnection()->insertArray($this->getMainTable(), array_keys($fields), $rows);
        }
src/module-elasticsuite-catalog/Model/ResourceModel/Category/FilterableAttribute.php on lines 93..95

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

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($rows)) {
            $result = (bool) $this->getConnection()->insertArray($this->getMainTable(), array_keys($fields), $rows);
        }
src/module-elasticsuite-catalog-optimizer/Model/ResourceModel/Optimizer/Limitation.php on lines 102..104

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

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(
        \Magento\Backend\Block\Template\Context $context,
        \Smile\ElasticsuiteAnalytics\Model\Search\Usage\Kpi\Report $report,
        \Magento\Framework\Serialize\Serializer\Json $serializer,
        array $data = []
src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/ConversionRates.php on lines 45..54
src/module-elasticsuite-analytics/Block/Adminhtml/Search/Usage/Chart/Spellcheck.php on lines 45..54

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

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

        return [
            $this->metricFactory->create(
                ['name' => 'minDate', 'field' => 'date', 'type' => MetricInterface::TYPE_MIN]
            ),
            $this->metricFactory->create(
src/module-elasticsuite-analytics/Model/Search/Usage/Terms/NoResultTerms/AggregationProvider.php on lines 51..58

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

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

        $metrics = [
            $this->metricFactory->create(
                ['name' => 'unique_sessions', 'field' => 'session_id', 'type' => MetricInterface::TYPE_CARDINALITY]
            ),
            $this->metricFactory->create(
src/module-elasticsuite-tracker/Model/ResourceModel/EventIndex/DateBounds.php on lines 170..177

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

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

    public function __construct(
        $name,
        array $queries,
        array $metrics = [],
        array $childBuckets = [],
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 63.

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 _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

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

                                    ItemFactory $itemFactory,
                                    Collection\Provider $productCollectionProvider,
                                    ConfigurationHelper $configurationHelper,
                                    ContextInterface    $searchContext,
                                    $type = self::AUTOCOMPLETE_TYPE
                              Severity
                              Category
                              Status
                              Source
                              Language