Showing 9 of 9 total issues
Index
has 12 functions (exceeds 10 allowed). Consider refactoring. Open
class Index{ /** * @var string */
Function getSynonymRewrites
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getSynonymRewrites($storeId, $queryText, $type, $maxRewrites) { $indexName = $this->getIndexAlias($storeId); $analyzedQueries = $this->getQueryCombinations($storeId, str_replace('-', ' ', $queryText)); $synonyms = [];
- Read upRead up
Function combineSynonyms
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function combineSynonyms($queryText, $synonymByPositions, $maxRewrites, $substitutions = 0, $offset = 0) { $combinations = []; if (!empty($synonymByPositions) && $substitutions < $maxRewrites) {
- Read upRead up
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ClientInterface $client, IndexSettingsHelper $indexSettingsHelper, CacheHelper $cacheHelper, ThesaurusConfigFactory $thesaurusConfigFactory, ThesaurusCacheConfig $thesaurusCacheConfig
Method combineSynonyms
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function combineSynonyms($queryText, $synonymByPositions, $maxRewrites, $substitutions = 0, $offset = 0)
Assigning \Smile\ElasticsuiteThesaurus\Config\ThesaurusCacheConfig
to property but \Smile\ElasticsuiteThesaurus\Model\Index->thesaurusCacheConfig
is \Smile\ElasticsuiteThesaurus\Config\ThesaurusConfig
Open
$this->thesaurusCacheConfig = $thesaurusCacheConfig;
- Exclude checks
Argument 3 (baseWeight)
is float
but \Smile\ElasticsuiteThesaurus\Model\Index::getWeightedRewrites()
takes int
defined at /code/src/module-elasticsuite-thesaurus/Model/Index.php:362
Open
$rewrites = $this->getWeightedRewrites($synonymRewrites, $config->getSynonymWeightDivider(), $originalBoost);
- Exclude checks
Returning type \Smile\ElasticsuiteCore\Api\Search\Request\Container\RelevanceConfigurationInterface
but getConfig()
is declared to return \Smile\ElasticsuiteThesaurus\Config\ThesaurusConfig
Open
return $this->thesaurusConfigFactory->create($storeId, $containerName);
- Exclude checks
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function __construct( ClientInterface $client, IndexSettingsHelper $indexSettingsHelper, CacheHelper $cacheHelper, ThesaurusConfigFactory $thesaurusConfigFactory,
- Read upRead up