Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Customer\Model\Session $customerSession,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Smile\ElasticsuiteCore\Helper\Mapping $mappingHelper,
\Smile\ElasticsuiteCore\Api\Search\ContextInterface $searchContext,
\Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
Function afterGetFilters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function afterGetFilters(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
- 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 addDefaultSortOrders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addDefaultSortOrders($sortOrders, $containerConfiguration)
{
if ($containerConfiguration->getName() == "catalog_view_container" && empty($sortOrders)) {
$sortOrders['position'] = ['direction' => SortOrderInterface::SORT_ASC];
}
- 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 getCurrentCategoryId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getCurrentCategoryId(ContainerConfigurationInterface $containerConfiguration, SearchCriteriaInterface $searchCriteria)
{
if ($this->searchContext->getCurrentCategory() && $this->searchContext->getCurrentCategory()->getId()) {
return $this->searchContext->getCurrentCategory()->getId();
}
- 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 afterGetSortOrders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function afterGetSortOrders(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
- 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"