Showing 607 of 1,357 total issues
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
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
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
Function aroundReindex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function aroundReindex(\Magento\Catalog\Model\Category $category, \Closure $proceed)
{
$proceed();
// Reindex only if attached product list has changed.
- 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,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
StoreManagerInterface $storeManager,
CategoryRepositoryInterface $categoryRepository,
Conditions $conditionsHelper,
SkuPositionSortOrderBuilder $skuPositionSortOrderBuilder,
Provider $filterProvider,
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
Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
\Magento\Framework\Registry $registry,
\Magento\Cms\Model\Page $page,
Function isEventInvalid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function isEventInvalid($data)
{
$isEventInvalid = true;
if (isset($data['page']['store_id']) && is_numeric($data['page']['store_id'])) {
- 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
Avoid deeply nested control flow statements. Open
if ($queryFilter !== null) {
$filterQueries[] = $queryFilter;
}
Method beforeResolve
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ResolverInterface $subject,
Field $field,
$context,
ResolveInfo $info,
array $value = null,
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
SearchInterface $search,
SearchResultFactory $searchResultFactory,
FieldSelection $fieldSelection,
ProductSearch $productProvider,
SearchCriteriaBuilder $searchCriteriaBuilder,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ScopeConfigInterface $scopeConfig,
StoreManagerInterface $storeManager,
CategoryCollectionFactory $categoryCollectionFactory,
UrlFinderInterface $urlFinder,
UrlInterface $urlBuilder,
Function beforeGetImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function beforeGetImage(
\Magento\Catalog\Block\Product\AbstractProduct $subject,
\Magento\Catalog\Model\Product $product,
$location,
array $attributes = []
- 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
Consider simplifying this complex logical expression. Open
if ((this.options.values.length === 2 && this.options.range === true) &&
((index === 0 && newVal > otherVal) || (index === 1 && newVal < otherVal))
) {
newVal = otherVal;
}
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
DbContext $context,
RuleFactory $ruleFactory,
SerializerInterface $serializer,
array $containerToLimitationDataMapping = [],
$connectionName = null
Function _updateBezierControlPoints
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
Function _measureText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function _measureText(ctx, data, gc, longest, string) {