Showing 7 of 7 total issues
Function getSubtreeBreadcrumbPath
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function getSubtreeBreadcrumbPath($helper, $appliedRoot) { if (!$this->categoryPath) { $path = []; $category = $helper->getCategory();
- Read upRead up
Avoid too many return
statements within this method. Open
return false;
Assigning array<string>|array{product:array{label:mixed}}|array{}</string>
to property but \Smile\ElasticsuiteVirtualCategory\Plugin\Catalog\Helper\BreadcrumbPlugin->categoryPath
is null
Open
$this->categoryPath = $path;
- Exclude checks
Returning type null
but getSubtreeBreadcrumbPath()
is declared to return array
Open
return $this->categoryPath;
- Exclude checks
Argument 1 (appliedRoot)
is \Magento\Catalog\Model\Category
but \Smile\ElasticsuiteVirtualCategory\Model\VirtualCategory\Root::getSubtreePathIds()
takes \Magento\Catalog\Api\Data\CategoryInterface
defined at /code/src/module-elasticsuite-virtual-category/Model/VirtualCategory/Root.php:159
Open
$categoryIds = $this->virtualCategoryRoot->getSubtreePathIds($appliedRoot, $category);
- Exclude checks
Argument 1 (appliedRootCategory)
is \Magento\Catalog\Model\Category|null
but \Smile\ElasticsuiteVirtualCategory\Model\Url::getVirtualCategorySubtreeUrl()
takes \Magento\Catalog\Api\Data\CategoryInterface
defined at /code/src/module-elasticsuite-virtual-category/Model/Url.php:200
Open
$this->virtualCategoryRoot->getAppliedRootCategory(),
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
private function getCategoriesByIds($categoryIds) { $collection = $this->categoryCollectionFactory->create(); $collection->addIsActiveFilter()
- Read upRead up