Showing 620 of 1,375 total issues
Function getValueElementType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getValueElementType()
{
$valueElementType = 'text';
if ($this->getAttribute() == 'attribute_set_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
Function addFieldToFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addFieldToFilter($field, $condition = null)
{
$type = 'include';
if ($field === 'index_status') {
$type = 'exclude';
- 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 afterGetSortOrders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function afterGetSortOrders(
RequestMapper $subject,
$result,
ContainerConfigurationInterface $containerConfiguration,
SearchCriteriaInterface $searchCriteria
- 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 getList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getList()
{
if (null === $this->attributeList) {
$cacheKey = self::CACHE_KEY;
$attributesList = $this->cache->load($cacheKey);
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as &$item) {
$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 loadChildrens
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadChildrens($productIds, $storeId)
{
$children = [];
foreach ($this->catalogProductType->getCompositeTypes() as $productTypeId) {
- 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 getElasticSuiteIndices
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getElasticSuiteIndices(): ?array
{
if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) {
$elasticSuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices();
$excludedIndexStatus = [
- 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 getSearchQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchQuery(ProductCondition $condition)
{
// Retrieve the operator and days from the condition.
$operator = $condition->getOperator();
$value = (int) $condition->getValue();
- 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 canIndexAttribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function canIndexAttribute(AttributeInterface $attribute)
{
// 'price' attribute is declared as nested field into the indices file.
$canIndex = $attribute->getBackendType() != 'static' && $attribute->getAttributeCode() !== 'price';
- 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 _prepareValueOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _prepareValueOptions()
{
$selectReady = $this->getData('value_select_options');
$hashedReady = $this->getData('value_option');
- 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 prepareAdaptiveIntervals
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function prepareAdaptiveIntervals(): array
{
$adaptiveIntervals = [];
$intervals = $this->getIntervals();
- 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 getAggregationData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getAggregationData(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute)
{
$type = $attribute->getBackendType();
$aggregation = isset($this->aggregations[$type]) ? $this->aggregations[$type] : $this->defaultAggregation;
- 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 loadArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadArray($arr, $key = 'conditions')
{
$aggregator = $this->getAggregatorFromArray($arr);
$value = $this->getValueFromArray($arr);
- 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 getMappingFieldOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getMappingFieldOptions(AttributeInterface $attribute)
{
$options = [
'is_searchable' => $attribute->getIsSearchable(),
'is_filterable' => $attribute->getIsFilterable() || $attribute->getIsFilterableInSearch(),
- 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 getDataSources
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDataSources(string $indexName)
{
$sources = [];
if (isset($this->datasources[$indexName]) && isset($this->datasources[$indexName])) {
- 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 getVersion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getVersion()
{
$this->version = $this->version ?: $this->cache->load(self::VERSION_CACHE_KEY);
if (!$this->version) {
- 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 buildBucket
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_TOP_HITS) {
throw new \InvalidArgumentException("Query builder : invalid aggregation type {$bucket->getType()}.");
}
- 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 getDynamicFields
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getDynamicFields($indexName)
{
$fields = [];
$cacheId = implode('|', [$this->cacheId, $indexName]);
$fieldsConfig = $this->cache->load($cacheId);
- 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 createQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function createQuery(ContainerConfigurationInterface $containerConfiguration, $query, array $filters, $spellingType)
{
$queryParams = [];
if ($query) {
- 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 getHosts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getHosts(array $options): array
{
$hosts = [];
if (is_string($options['servers'])) {
- 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"