Showing 607 of 1,357 total issues
Avoid too many return
statements within this method. Open
return $resultRedirect->setPath('*/*/');
Avoid too many return
statements within this method. Open
return $resultRedirect->setPath('*/*/index');
Avoid too many return
statements within this method. Open
return array_key_exists(array_shift($keys), $array);
Avoid too many return
statements within this method. Open
return $filters;
Avoid too many return
statements within this method. Open
return $resultRedirect->setPath('*/*/');
Avoid too many return
statements within this method. Open
return $resultRedirect->setPath('*/*/index');
Avoid too many return
statements within this method. Open
return $this->actionFactory->create('Magento\Framework\App\Action\Forward');
Avoid too many return
statements within this method. Open
return $items;
Avoid too many return
statements within this method. Open
return ['category_uid' => $result];
Avoid too many return
statements within this method. Open
return $action;
Function getProductPrice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getProductPrice()
{
$price = 0;
$document = $this->getDocumentSource();
- 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 parseDateFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseDateFields()
{
if ('' === $this->getFromDate()) {
$this->unsFromDate();
}
- 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 setSortParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setSortParams(
\Magento\Catalog\Model\Layer $layer,
\Magento\Catalog\Model\ResourceModel\Collection\AbstractCollection $collection
) {
$searchQuery = $this->queryFactory->get();
- 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 addIndexedFilterToAttributeCollection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addIndexedFilterToAttributeCollection(AttributeCollection $attributeCollection)
{
$conditions = [];
foreach ($this->indexedAttributesConditions as $fieldName => $condition) {
- 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 prepareDataSource
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as & $item) {
$name = $this->getData('name');
- 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 addProductData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addProductData($data)
{
$product = $data['product'];
$productData = [
- 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 isRebuilding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isRebuilding(string $indexName, $indexDate): bool
{
if (!empty($this->workingIndexers)) {
foreach (array_keys($this->workingIndexers) as $indexKey) {
if (strpos((string) $indexName, $indexKey) !== false) {
- 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 buildRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function buildRow($item, $fields)
{
// Remove position for not pinned items.
if (empty($item['is_pinned']) || filter_var($item['is_pinned'], FILTER_VALIDATE_BOOLEAN) === false) {
$item['position'] = null;
- 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 addAttributeData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addAttributeData($storeId, $productIds, $indexData = [])
{
foreach ($this->attributeIdsByTable as $backendTable => $attributeIds) {
$attributesData = $this->loadAttributesRawData($storeId, $productIds, $backendTable, $attributeIds);
foreach ($attributesData as $row) {
- 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 loadProductCounts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function loadProductCounts(): void
{
$storeId = $this->getStoreId();
$requestName = $this->searchRequestName;
$facets = [
- 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"