Showing 620 of 1,375 total issues
Function handleNestedField
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function handleNestedField($eventData, $field)
{
$fieldPath = $field->getNestedPath();
if ($eventData->hasData($fieldPath)) {
$fieldName = $field->getNestedFieldName();
- 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 addChildrenQueries
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function addChildrenQueries($query, CategoryInterface $category, $excludedCategories = []): QueryInterface
{
$childrenCategories = $this->getChildrenCategories($category, $excludedCategories);
$childrenCategoriesIds = [];
- 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
Consider simplifying this complex logical expression. Open
if (!options.childList && !options.attributes && !options.characterData ||
// 1.2
options.attributeOldValue && !options.attributes ||
Function json2html
has 65 lines of code (exceeds 40 allowed). Consider refactoring. Open
function json2html(json, options) {
var html = '';
if (typeof json === 'string') {
// Escape tags and quotes
json = json
Method _initElement
has 65 lines of code (exceeds 40 allowed). Consider refactoring. Open
protected function _initElement(
\Magento\Config\Model\Config\Structure\Element\Field $field,
\Magento\Framework\Data\Form\Element\Fieldset $fieldset,
$path,
$fieldPrefix = '',
Method __construct
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
Registry $registry,
FormFactory $formFactory,
TimezoneInterface $localeDate,
CombineConditionFactory $combineConditionsFactory,
Function _refreshValue
has 64 lines of code (exceeds 40 allowed). Consider refactoring. Open
_refreshValue: function () {
var lastValPercent, valPercent, value, valueMin, valueMax,
oRange = this.options.range,
o = this.options,
that = this,
Function _drawColorBox
has 63 lines of code (exceeds 40 allowed). Consider refactoring. Open
_drawColorBox(ctx, pt, i, rtlHelper, options) {
const me = this;
const labelColors = me.labelColors[i];
const labelPointStyle = me.labelPointStyles[i];
const {boxHeight, boxWidth} = options;
Function getSearchQuery
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getSearchQuery(ProductCondition $productCondition)
{
$query = null;
$query = $this->getSpecialAttributesSearchQuery($productCondition);
- 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 applyPostFilters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function applyPostFilters(array $filters = [], array $indices = [])
{
$filtered = [];
foreach ($indices as $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 saveIndex
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function saveIndex($dimensions, \Traversable $documents)
{
foreach ($dimensions as $dimension) {
$storeId = $dimension->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 getLanguageStemmers
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguageStemmers(\DOMXPath $xpath, \DomNode $rootNode, $defaultStemmer = null)
{
$stemmers = [];
$searchPath = sprintf("./%s", self::STEMMER_TYPE_NODE);
- 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 getItems
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getItems()
{
if ($this->items === null) {
$this->items = [];
- 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 loadVariationByFallback
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function loadVariationByFallback(Product $parentProduct, array $attributes)
{
$variation = false;
if ($this->isProductHasSwatch($parentProduct) && $parentProduct->getDocumentSource() !== null) {
- 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 handleEvent
has 62 lines of code (exceeds 40 allowed). Consider refactoring. Open
handleEvent: function(e) {
// Stop propagation since we are managing the propagation manually.
// This means that other mutation events on the page will not work
// correctly but that is by design.
e.stopImmediatePropagation();
Method build
has 61 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function build(AggregationInterface $aggregation, ?int $storeId): array
{
$prefix = Mapping::OPTION_TEXT_PREFIX . '_';
$result = [];
Method __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Framework\Data\Collection\EntityFactory $entityFactory,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
\Magento\Framework\Event\ManagerInterface $eventManager,
\Magento\Eav\Model\Config $eavConfig,
Function getPropertyConfig
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED): array
{
$fieldMapping = ['type' => $this->getType()];
switch ($this->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 indexEvents
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function indexEvents($events)
{
$sessionIdsByStore = $this->getSessionIdsByStore($events);
$bulk = $this->indexOperation->createBulk();
$indices = [];
- 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 14 arguments (exceeds 4 allowed). Consider refactoring. Open
\Magento\Rule\Model\Condition\Context $context,
\Magento\Backend\Helper\Data $backendData,
\Magento\Eav\Model\Config $config,
\Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\AttributeList $attributeList,
\Smile\ElasticsuiteCatalogRule\Model\Rule\Condition\Product\QueryBuilder $queryBuilder,