Showing 620 of 1,375 total issues
File Rule.php
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
Function loadStores
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function loadStores()
{
$itemIds = array_keys($this->_items);
if (count($itemIds)) {
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
public function build(AggregationInterface $aggregation, ?int $storeId): array
{
$prefix = Mapping::OPTION_TEXT_PREFIX . '_';
$result = [];
- 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
File MutationObserver.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
Function _computeGridLineItems
has 110 lines of code (exceeds 40 allowed). Consider refactoring. Open
_computeGridLineItems(chartArea) {
const me = this;
const axis = me.axis;
const chart = me.chart;
const options = me.options;
FrontPlugin
has 20 functions (exceeds 10 allowed). Consider refactoring. Open
class FrontPlugin
{
/**
* @var array
*/
Function addData
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function addData($storeId, array $indexData): array
{
if ($this->ignorePositions->isIgnoreOosPositions($storeId)) {
foreach ($indexData as &$productData) {
if (isset($productData['stock']['is_in_stock']) && (bool) $productData['stock']['is_in_stock'] === 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
RelevanceConfig
has 19 functions (exceeds 10 allowed). Consider refactoring. Open
class RelevanceConfig implements RelevanceConfigurationInterface
{
/**
* @var string
*/
Rule
has 19 functions (exceeds 10 allowed). Consider refactoring. Open
class Rule extends \Smile\ElasticsuiteCatalogRule\Model\Rule implements VirtualRuleInterface
{
/**
* @var QueryFactory
*/
Function drawPoint
has 100 lines of code (exceeds 40 allowed). Consider refactoring. Open
function drawPoint(ctx, options, x, y) {
let type, xOffset, yOffset, size, cornerRadius;
const style = options.pointStyle;
const rotation = options.rotation;
const radius = options.radius;
File product-sorter.js
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
* versions in the future.
Thesaurus
has 18 functions (exceeds 10 allowed). Consider refactoring. Open
class Thesaurus extends \Magento\Framework\Model\AbstractModel implements ThesaurusInterface
{
/**
* Name of the Thesaurus Expanded Terms Mysql Table
*/
Function saveThesaurusFinish
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function saveThesaurusFinish(array $thesaurusData): bool
{
foreach ($thesaurusData as $thesaurusRows) {
foreach ($thesaurusRows as $row) {
$model = $this->importProvider->createThesaurus();
- 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
File Converter.php
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
Function switchDefaultValueField
has 95 lines of code (exceeds 40 allowed). Consider refactoring. Open
switchDefaultValueField: function () {
var currentValue = this.frontendInput.val(),
defaultValueTextVisibility = false,
defaultValueTextareaVisibility = false,
defaultValueDateVisibility = false,
AbstractAttribute
has 17 functions (exceeds 10 allowed). Consider refactoring. Open
abstract class AbstractAttribute extends Mapping
{
/**
* @var \Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory
*/
Function addData
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function addData($storeId, array $indexData)
{
$productIds = array_keys($indexData);
$priceData = $this->resourceModel->loadPriceData($storeId, $productIds);
- 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 24 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,
MoreLikeThis
has 16 functions (exceeds 10 allowed). Consider refactoring. Open
class MoreLikeThis implements QueryInterface
{
/**
* @var string
*/
Data
has 16 functions (exceeds 10 allowed). Consider refactoring. Open
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
/**
* Module status configuration path
* @var string