Showing 620 of 1,375 total issues
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Template\Context $context,
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Smile\ElasticsuiteTracker\Helper\Data $trackerHelper,
\Magento\Framework\Registry $registry,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
CategoryAttributeQuery $categoryAttributeQuery,
CategoryAttributesMapper $categoryAttributesMapper,
RootCategoryProvider $rootCategoryProvider,
LayerFormatter $layerFormatter,
ResourceConnection $resourceConnection,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
PageFactory $resultPageFactory,
Registry $coreRegistry,
ThesaurusRepositoryInterface $thesaurusRepository,
ThesaurusFactory $thesaurusFactory,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Store\Model\StoreManagerInterface $storeManager,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Template\Context $context,
Data $jsonHelper,
TrackerHelper $trackerHelper,
Registry $registry,
PageTypeConfig $pageTypeConfig,
Function canApply
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function canApply() : bool
{
if (empty($this->optimizer->getSearchContainer())) {
return 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 getElasticsuiteIndexMaxSize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getElasticsuiteIndexMaxSize()
{
if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) {
$elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices();
$indexSizes = [];
- 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 9 (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 getNumberOfGhostIndices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getNumberOfGhostIndices()
{
if ($this->indexStatsProvider->getElasticSuiteIndices() !== null) {
$elasticsuiteIndices = $this->indexStatsProvider->getElasticSuiteIndices();
$ghostIndices = [];
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function buildBucket(BucketInterface $bucket)
{
if ($bucket->getType() !== BucketInterface::TYPE_TERM) {
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 getSpanQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getSpanQuery(ContainerConfigurationInterface $containerConfig, $queryText, $boost)
{
$query = null;
$terms = explode(' ', $queryText);
- 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 parseTermVectors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function parseTermVectors($termVectors, $cutoffFrequencyLimit, $useAllTokens = false)
{
$queryTermStats = ['stop' => 0, 'exact' => 0, 'standard' => 0, 'missing' => 0];
$statByPosition = $this->extractTermStatsByPosition($termVectors, $useAllTokens);
- 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 getLayerVariables
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getLayerVariables()
{
$variables = [];
$layer = $this->catalogLayer;
- 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 deleteThesaurusFinish
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function deleteThesaurusFinish(array $thesaurusIds): bool
{
if ($thesaurusIds) {
try {
foreach ($thesaurusIds as $thesaurusId) {
- 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 buildCategorySearchQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function buildCategorySearchQuery($category, $excludedCategories = []): ?QueryInterface
{
$query = null;
if (!in_array($category->getId(), $excludedCategories)) {
- 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 combineSynonyms
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function combineSynonyms($queryText, $synonymByPositions, $maxRewrites, $substitutions = 0, $offset = 0)
{
$combinations = [];
if (!empty($synonymByPositions) && $substitutions < $maxRewrites) {
- 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 postProcessResponse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function postProcessResponse($data)
{
$terms = array_keys($data);
$storeId = $this->context->getStoreId();
- 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 getCategorySearchQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getCategorySearchQuery($excludedCategories): ?QueryInterface
{
$categoryIds = [];
$subQueries = [];
$valueArray = $this->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 loadVariationsFromSearchIndex
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function loadVariationsFromSearchIndex(Product $parentProduct, array $attributes)
{
$documentSource = $parentProduct->getDocumentSource();
$childrenIds = isset($documentSource['children_ids']) ? $documentSource['children_ids'] : [];
$variation = 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
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Framework\Stdlib\DateTime\DateTime $date,