Showing 620 of 1,375 total issues
Method __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Layer $layer,
\Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder,
\Magento\Framework\Escaper $escaper,
Function update
has 58 lines of code (exceeds 40 allowed). Consider refactoring. Open
update(chart, width, height, minPadding) {
if (!chart) {
return;
}
const padding = toPadding(chart.options.layout.padding);
Function keydown
has 57 lines of code (exceeds 40 allowed). Consider refactoring. Open
keydown: function (event) {
var allowed, curVal, newVal, step,
index = $(event.target).data("ui-slider-handle-index");
switch (event.keyCode) {
Function buildOrUpdateScales
has 57 lines of code (exceeds 40 allowed). Consider refactoring. Open
buildOrUpdateScales() {
const me = this;
const options = me.options;
const scaleOpts = options.scales;
const scales = me.scales;
Method postProcessResponse
has 57 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function postProcessResponse($data)
{
$terms = array_keys($data);
$storeId = $this->context->getStoreId();
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
Data $backendData,
Config $config,
AttributeList $attributeList,
QueryBuilder $queryBuilder,
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Catalog\Model\Layer\Filter\ItemFactory $filterItemFactory,
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Catalog\Model\Layer $layer,
\Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder,
\Magento\Catalog\Model\ResourceModel\Layer\Filter\Price $resource,
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$field,
array $metrics = [],
array $childBuckets = [],
array $pipelines = [],
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$field,
array $metrics = [],
array $childBuckets = [],
array $pipelines = [],
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
array $fields,
$like,
$minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
$boostTerms = self::DEFAULT_BOOST_TERMS,
$minTermFreq = self::DEFAULT_MIN_TERM_FREQ,
Function aroundGetData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function aroundGetData(CategoryDataProvider $dataProvider, \Closure $proceed)
{
$data = $proceed();
$currentCategory = $dataProvider->getCurrentCategory();
- 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 updateAttributeData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function updateAttributeData($attribute, $rowData)
{
$dataChanged = false;
foreach ($rowData as $key => $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 getAllDefaultLanguageStemmers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getAllDefaultLanguageStemmers(\DOMXPath $xpath)
{
$defaultStemmers = [];
$filterPath = "@type='stemmer' and @name='stemmer'";
- 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 prepareFieldCondition
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function prepareFieldCondition(FieldInterface $field, $condition, $currentPath)
{
$queryType = QueryInterface::TYPE_TERMS;
$condition = $this->prepareCondition($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 buildSordOrders
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function buildSordOrders(ContainerConfigurationInterface $containerConfig, array $orders)
{
$sortOrders = [];
$mapping = $containerConfig->getMapping();
- 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 create
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function create(ContainerConfigurationInterface $containerConfig, $queryText, $spellingType, $boost = 1, $depth = 0)
{
$query = null;
$fuzzySpellingTypes = [SpellcheckerInterface::SPELLING_TYPE_FUZZY, SpellcheckerInterface::SPELLING_TYPE_MOST_FUZZY];
- 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 processNestedGroups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function processNestedGroups($group)
{
$data = [];
if (isset($group['fields']) && is_array($group['fields'])) {
- 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 saveTermsRelation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function saveTermsRelation(\Magento\Framework\Model\AbstractModel $object)
{
$termRelations = $object->getTermsRelations() ?? [];
$termRelations = array_filter($termRelations);
- 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 getFilterArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getFilterArray(array $request, \Magento\Catalog\Model\Product $product)
{
$filterArray = [];
$attributes = $this->eavConfig->getEntityAttributes(\Magento\Catalog\Model\Product::ENTITY, $product);
- 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 _calculateBarValuePixels
has 54 lines of code (exceeds 40 allowed). Consider refactoring. Open
_calculateBarValuePixels(index) {
const me = this;
const {vScale, _stacked} = me._cachedMeta;
const {base: baseValue, minBarLength} = me.options;
const parsed = me.getParsed(index);