Showing 132 of 165 total issues
Config
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class Config
{
/**
* Recommendation types
*/
Function getSwatchData
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function getSwatchData()
{
if (false === $this->eavAttribute instanceof Attribute) {
throw new RuntimeException('Magento_Swatches: RenderLayered: Attribute has not been set.');
}
- 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
File QueryParameterStrategy.php
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
Filter
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class Filter extends AbstractFilter implements FilterInterface
{
/**
* @var string
*/
File PathSlugStrategy.php
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
File Config.php
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
Function getShoppingcartCrosssellItems
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function getShoppingcartCrosssellItems(array $cartProductIds, array $result)
{
$items = [];
if ($cartProductIds) {
- 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 getShoppingcartCrosssellItems
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function getShoppingcartCrosssellItems(array $cartProductIds, array $result)
{
$items = [];
if ($cartProductIds) {
- 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 21 arguments (exceeds 4 allowed). Consider refactoring. Open
CollectionEntityFactory $entityFactory,
LoggerInterface $logger,
FetchStrategyInterface $fetchStrategy,
ManagerInterface $eventManager,
EavConfig $eavConfig,
Method __construct
has 21 arguments (exceeds 4 allowed). Consider refactoring. Open
CollectionEntityFactory $entityFactory,
LoggerInterface $logger,
FetchStrategyInterface $fetchStrategy,
ManagerInterface $eventManager,
EavConfig $eavConfig,
File navigation-form.js
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
* @copyright Copyright (c) 2017-2022 Tweakwise.com B.V. (https://www.tweakwise.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
File Filter.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Tweakwise (https://www.tweakwise.com/) - All Rights Reserved
*
DefaultRenderer
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class DefaultRenderer extends Template
{
use AnchorRendererTrait;
/**
SettingsType
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class SettingsType extends Type
{
/**
* Source type from attributes
*/
Function _updateBlocks
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_updateBlocks: function (htmlResponse) {
var filterSelector = this.options.filterSelector;
var productListSelector = this.options.productListSelector;
var toolbarSelector = this.options.toolbarSelector;
Method getSwatchData
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSwatchData()
{
if (false === $this->eavAttribute instanceof Attribute) {
throw new RuntimeException('Magento_Swatches: RenderLayered: Attribute has not been set.');
}
Function execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$json = $this->resultFactory->create('json');
$facetRequest = $this->requestFactory->create();
- 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 16 arguments (exceeds 4 allowed). Consider refactoring. Open
ConfigInterface $routeConfig,
RequestInterface $request,
SecurityInfoInterface $urlSecurityInfo,
ScopeResolverInterface $scopeResolver,
Generic $session,
Method execute
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$json = $this->resultFactory->create('json');
$facetRequest = $this->requestFactory->create();
Method getItems
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getItems()
{
$query = $this->dataProviderHelper->getQuery();
if (empty($query)) {
return [];