Smile-SA/elasticsuite

View on GitHub

Showing 620 of 1,375 total issues

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

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

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

        File QueryBuilder.php has 263 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * DISCLAIMER
         *
         * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer

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

              public function execute()
              {
                  /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
                  $resultRedirect = $this->resultRedirectFactory->create();
                  $data = $this->getRequest()->getPostValue();

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

              public function addData($storeId, array $indexData)
              {
                  $productIds   = array_keys($indexData);
                  $indexData    = $this->addAttributeData($storeId, $productIds, $indexData);
          
          

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

              public function updateSearchContext($args)
              {
                  if (!empty($args['search'])) {
                      try {
                          $query = $this->queryFactory->create()->loadByQueryText($args['search']);

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

              protected function isEventInvalid($data)
              {
                  $isEventInvalid = true;
          
                  if (isset($data['page']['store_id']) && is_numeric($data['page']['store_id'])) {
          Severity: Minor
          Found in src/module-elasticsuite-tracker/Model/ResourceModel/EventQueue.php - About 2 hrs 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 fitWithPointLabels has 71 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

              function fitWithPointLabels(scale) {
                  const furthestLimits = {
                      l: 0,
                      r: scale.width,
                      t: 0,
          Severity: Major
          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 2 hrs to fix

            QueryBuilder has 11 functions (exceeds 10 allowed). Consider refactoring.
            Open

            class QueryBuilder
            {
                /**
                 * @var QueryFactory
                 */

              ProductDate has 11 functions (exceeds 10 allowed). Consider refactoring.
              Open

              class ProductDate implements SpecialAttributeInterface
              {
                  /**
                   * @var string
                   */

                Context has 11 functions (exceeds 10 allowed). Consider refactoring.
                Open

                class Context implements \Smile\ElasticsuiteCore\Api\Search\ContextInterface
                {
                    /**
                     * @var \Magento\Catalog\Api\Data\CategoryInterface
                     */
                Severity: Minor
                Found in src/module-elasticsuite-core/Search/Context.php - About 2 hrs to fix

                  Converter has 11 functions (exceeds 10 allowed). Consider refactoring.
                  Open

                  class Converter implements \Magento\Framework\Config\ConverterInterface
                  {
                      const ROOT_NODE_NAME             = 'analysis';
                      const CHAR_FILTER_TYPE_ROOT_NODE = 'char_filters';
                      const CHAR_FILTER_TYPE_NODE      = 'char_filter';
                  Severity: Minor
                  Found in src/module-elasticsuite-core/Index/Analysis/Config/Converter.php - About 2 hrs to fix

                    Request has 11 functions (exceeds 10 allowed). Consider refactoring.
                    Open

                    class Request extends \Magento\Framework\Search\Request implements RequestInterface
                    {
                        /**
                         * @var SortOrderInterface
                         */
                    Severity: Minor
                    Found in src/module-elasticsuite-core/Search/Request.php - About 2 hrs to fix

                      IndexSettings has 11 functions (exceeds 10 allowed). Consider refactoring.
                      Open

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

                        Thesaurus has 11 functions (exceeds 10 allowed). Consider refactoring.
                        Open

                        class Thesaurus extends AbstractEntity
                        {
                            const ENTITY_CODE = 'thesaurus';
                            const COL_TERMS = 'terms_relations';
                            const COL_STORES = 'stores';
                        Severity: Minor
                        Found in src/module-elasticsuite-thesaurus/Model/Import/Thesaurus.php - About 2 hrs to fix

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

                                  $minimumShouldMatch,
                                  $tieBreaker,
                                  $phraseMatchBoost,
                                  $cutOffFrequency,
                                  FuzzinessConfigurationInterface $fuzziness = null,

                            Function _initItems has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function _initItems()
                                {
                                    parent::_initItems();
                            
                                    foreach ($this->_items as $key => $item) {
                            Severity: Minor
                            Found in src/module-elasticsuite-catalog/Model/Layer/Filter/Boolean.php - About 2 hrs 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 addOptionsData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function addOptionsData(array $items)
                                {
                                    if ($this->getAttributeModel()->getFacetSortOrder() == BucketInterface::SORT_ORDER_MANUAL) {
                                        $options = $this->getAttributeModel()->getFrontend()->getSelectOptions();
                                        $optionPosition = 0;
                            Severity: Minor
                            Found in src/module-elasticsuite-catalog/Model/Layer/Filter/Attribute.php - About 2 hrs 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 getBucketValues has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getBucketValues($rawBucket)
                                {
                                    $values = [];
                            
                                    if (isset($rawBucket['sum_other_doc_count']) && $rawBucket['sum_other_doc_count'] > 0) {

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language