Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 6 of 6 total issues

Function getLayerVariables has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

private function getLayerVariables()
{
$variables = [];
$layer = $this->catalogLayer;
 
 
Severity: Minor
Found in src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php - About 55 mins to fix

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

Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
Severity: Major
Found in src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php - About 50 mins to fix

    Possibly zero references to use statement for classlike/namespace Navigation (\Smile\ElasticsuiteCatalog\Block\Navigation)
    Open

    use Smile\ElasticsuiteCatalog\Block\Navigation;

    Returning type null but getProductListBlock() is declared to return \Magento\Framework\View\Element\BlockInterface
    Open

    return is_object($productListBlock) ? $productListBlock : null;

    Argument 1 (categoryId) is string but \Smile\ElasticsuiteTracker\Block\Variables\Page\Catalog::getCategoryNameById() takes int defined at /code/src/module-elasticsuite-tracker/Block/Variables/Page/Catalog.php:233
    Open

    $breadcrumb[] = html_entity_decode($this->getCategoryNameById($categoryId, $category->getStoreId()));

    Possibly zero references to use statement for classlike/namespace Category (\Magento\Catalog\Model\Category)
    Open

    use Magento\Catalog\Model\Category;
    Category
    Status