Showing 620 of 1,375 total issues
Function getEffectOnProduct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getEffectOnProduct($baseProductIds, $optimizedProductIds, $productId)
{
$result = 0;
$baseProductPosition = array_search($productId, $baseProductIds);
$optimizedProductPosition = array_search($productId, $optimizedProductIds);
- Read upRead up
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
Context $context,
PageFactory $resultPageFactory,
FileFactory $fileFactory,
Filesystem $filesystem,
CollectionFactory $attributeCollectionFactory,
Method modifyAttributes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
JsonHelper $jsonHelper,
ImportHelper $importExportData,
Data $importData,
Config $eavConfig,
Helper $resourceHelper,
Function parsePipelineBucketsPath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function parsePipelineBucketsPath(\DOMXPath $xpath, \DOMNode $pipelineNode)
{
$bucketsPath = null;
foreach ($xpath->query(self::PIPELINE_COMPLEX_BUCKETS_PATH, $pipelineNode) as $bucketsPathMappingNode) {
- Read upRead up
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 parseAnalyzers
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\DOMXPath $xpath,
array $availableCharFilters,
array $availableFilters,
$language = self::LANGUAGE_DEFAULT,
$typeRootNode = self::ANALYZER_TYPE_ROOT_NODE,
Function build
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function build(array $options = []): \OpenSearch\Client
{
$options = array_merge($this->defaultOptions, $options);
$clientBuilder = $this->clientBuilder->create();
- Read upRead up
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 checkAnalyzer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkAnalyzer($property, $expectedAnalyzer): bool
{
$isAnalyzerCorrect = true;
if ($property['type'] === self::FIELD_TYPE_TEXT || $property['type'] === self::FIELD_TYPE_KEYWORD) {
- Read upRead up
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
ItemFactory $itemFactory,
QueryFactory $queryFactory,
TermDataProvider $termDataProvider,
CategoryCollectionFactory $categoryCollectionFactory,
ConfigurationHelper $configurationHelper,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$index,
$queryText,
$cutoffFrequency,
$isUsingAllTokens,
$isUsingReference,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\Search\Request\QueryInterface $query,
$functions = [],
$name = null,
$scoreMode = self::SCORE_MODE_SUM,
$boostMode = self::BOOST_MODE_SUM,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\ObjectManagerInterface $objectManager,
\Smile\ElasticsuiteCore\Api\Client\ClientInterface $client,
\Smile\ElasticsuiteCore\Api\Client\ClientConfigurationInterface $clientConfiguration,
\Smile\ElasticsuiteCore\Api\Index\IndexSettingsInterface $indexSettings,
PipelineManagerInterface $pipelineManager,
Function initScope
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function initScope()
{
if ($this->getSection() === null) {
$this->setSection('');
}
- Read upRead up
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 getFieldAnalyzers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getFieldAnalyzers(): array
{
$analyzers = [];
// By default, texts are indexed with "keyword" analyzer which is a 'noop' analyzer.
- Read upRead up
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
string $queryText,
int $kValue,
string $field = self::DEFAULT_EMBEDDING_FIELD,
?string $name = null,
float $boost = QueryInterface::DEFAULT_BOOST_VALUE,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$queryText,
$field,
$cutoffFrequency = self::DEFAULT_CUTOFF_FREQUENCY,
$minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
$name = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
StoreManagerInterface $storeManager,
Manager $moduleManager,
FieldIterator $childrenIterator,
Factory $cloneModelFactory,
Mapper $dependencyMapper,
Function getScopeCode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getScopeCode()
{
$scopeCode = $this->getData('scope_code');
if ($scopeCode === null) {
- Read upRead up
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 getAnalysisSettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getAnalysisSettings($store)
{
$language = $this->helper->getLanguageCode($store);
$settings = $this->analysisConfig->get($language);
- Read upRead up
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 toOptionArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toOptionArray()
{
$options = [
[
'label' => __('Please select a stemmer for the store'),
- Read upRead up
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"