Showing 607 of 1,357 total issues
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"
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 getNumberOfReplicasPerIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getNumberOfReplicasPerIndex(string $indexIdentifier): int
{
// Retrieve specific indices settings from the database.
$customSettings = $this->getCustomIndicesSettings();
- 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 buildQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function buildQuery(QueryInterface $query)
{
if ($query->getType() !== QueryInterface::TYPE_FUNCTIONSCORE) {
throw new \InvalidArgumentException("Query builder : invalid query type {$query->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 _initElement
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _initElement(
\Magento\Config\Model\Config\Structure\Element\Field $field,
\Magento\Framework\Data\Form\Element\Fieldset $fieldset,
$path,
$fieldPrefix = '',
- 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 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 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 getNumberOfShardsPerIndex
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getNumberOfShardsPerIndex(string $indexIdentifier): int
{
// Retrieve custom indices settings from the database.
$customSettings = $this->getCustomIndicesSettings();
- 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 build
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function build(AggregationInterface $aggregation, ?int $storeId): array
{
$bucket = $aggregation->getBucket(self::CATEGORY_BUCKET);
if ($this->isBucketEmpty($bucket)) {
- 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 enforce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function enforce($event)
{
if (!empty($this->fields)) {
$eventData = $this->dotObjectFactory->create(['data' => $event]);
- 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 processStoresData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function processStoresData($data): array
{
$storeIds = [];
if (empty($data)) {
- 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 aroundGetData
has a Cognitive Complexity of 7 (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 afterGetFilters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function afterGetFilters(
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 getIndicesToDelete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getIndicesToDelete(\DateTime $thresholdDate, array $indices, string $indexAlias): array
{
$indicesToDelete = [];
foreach ($indices as $index) {
$date = str_replace("{$indexAlias}_", '', $index);
- 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 getAttributeBuckets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getAttributeBuckets(AggregationInterface $aggregation)
{
foreach ($aggregation->getBuckets() as $bucket) {
if (\in_array($bucket->getName(), $this->bucketNameFilter, true)) {
continue;
- 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 addCustomerLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function addCustomerLink($eventData)
{
// The customerId is set in session if the Magento_Persistent module is enabled and a persistent session exists.
if ($this->customerSession->getCustomerId() !== null) {
$customerId = $this->customerSession->getCustomerId();
- 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 checkThesaurusTerms
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function checkThesaurusTerms()
{
$termsData = $this->getTermsData();
$terms = [];
- 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"