Showing 620 of 1,375 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Smile\ElasticsuiteCore\Search\Request\Builder $searchRequestBuilder,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Smile\ElasticsuiteCore\Api\Search\Request\ContainerConfigurationInterfaceFactory $containerConfigFactory,
\Smile\ElasticsuiteCore\Api\Search\ContextInterface $searchContext,
\Magento\Search\Model\QueryFactory $queryFactory,
Function getIndexOptionText
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getIndexOptionText($attributeId, $storeId, $optionId)
{
$attribute = $this->getAttributeByStore($attributeId, $storeId);
if (!isset($this->attributeOptionTextCache[$storeId]) || !isset($this->attributeOptionTextCache[$storeId][$attributeId])) {
- 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,
Structure $configStructure,
ConfigSectionChecker $sectionChecker,
Factory $configFactory,
FrontendInterface $cache,
Avoid deeply nested control flow statements. Open
if ($queryFilter !== null) {
$filterQueries[] = $queryFilter;
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\Smile\ElasticsuiteCore\Api\Search\ContextInterface $contextInterface,
\Smile\ElasticsuiteVirtualCategory\Helper\Rule $helper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository,
\Smile\ElasticsuiteVirtualCategory\Model\VirtualCategory\Root $virtualCategoryRoot,
Function addCustomerLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addCustomerLink(&$eventData)
{
// The customerId should be sent by the frontend, if any.
$customerId = $eventData['customer']['id'] ?? null;
if ($customerId !== null && ((int) $customerId > 0)) {
- 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 aroundCreate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function aroundCreate(
QueryBuilder $subject,
\Closure $proceed,
ContainerConfigurationInterface $containerConfig,
$queryText,
- 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
Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
\Magento\Framework\Registry $registry,
\Magento\Checkout\Model\Session $checkoutSession,
Avoid deeply nested control flow statements. Open
if (!empty($filterQueries)) {
$query = $this->queryFactory->create(QueryInterface::TYPE_BOOL, ['should' => $filterQueries]);
$collection->addQueryFilter($query);
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
JsonHelper $jsonHelper,
ImportHelper $importExportData,
Data $importData,
Helper $resourceHelper,
ProcessingErrorAggregatorInterface $errorAggregator,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
Registry $registry,
FormFactory $formFactory,
Store $systemStore,
Yesno $booleanSource,
Method modifyAggregations
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)
Function getCategoriesQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getCategoriesQuery($categoriesFilter, $storeId)
{
$result = [];
foreach ($categoriesFilter as $operator => $categoryIds) {
- 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,
IndexOperationInterface $indexOperation,
EventQueueInterface $eventQueue,
AnalyticsHelper $config,
ReportContext $reportContext,
Function processResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function processResponse(\Smile\ElasticsuiteCore\Search\Adapter\Elasticsuite\Response\QueryResponse $response)
{
$data = [];
foreach ($this->getBucketValues($response) as $value) {
- 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
Builder $searchRequestBuilder,
SearchEngineInterface $searchEngine,
Context $context,
AggregationFactory $aggregationFactory,
MetricFactory $metricFactory,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchInterface $search,
SearchResultFactory $searchResultFactory,
FieldSelection $fieldSelection,
ProductSearch $productProvider,
SearchCriteriaBuilder $searchCriteriaBuilder,
Method __construct
has 6 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\Cms\Model\Page $page,
Function afterAddProduct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function afterAddProduct(
Quote $subject,
$result
) {
if (!$this->trackerHelper->isHeadlessMode()) {
- 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 modifyAttributes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)