Showing 620 of 1,375 total issues
File form-mini.js
has 290 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.
Function migrateDailyToMonthlyIndices
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function migrateDailyToMonthlyIndices(): void
{
$indexIdentifiers = [SessionIndexInterface::INDEX_IDENTIFIER, EventIndexInterface::INDEX_IDENTIFIER];
foreach ($indexIdentifiers as $indexIdentifier) {
- 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
Collection
has 15 functions (exceeds 10 allowed). Consider refactoring. Open
class Collection extends \Magento\Catalog\Model\ResourceModel\Category\Collection
{
/**
* @var \Smile\ElasticsuiteCore\Search\Request\Builder
*/
IndexOperation
has 15 functions (exceeds 10 allowed). Consider refactoring. Open
class IndexOperation implements IndexOperationInterface
{
/**
* @var \Magento\Framework\ObjectManagerInterface
*/
ClientConfiguration
has 15 functions (exceeds 10 allowed). Consider refactoring. Open
class ClientConfiguration implements ClientConfigurationInterface
{
/**
* Location of Elasticsearch client configuration.
*
File tracking.js
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global document: true */
/* global window: true */
/* global console: true */
/* exported smileTracker */
Function generateTicks$1
has 82 lines of code (exceeds 40 allowed). Consider refactoring. Open
function generateTicks$1(generationOptions, dataRange) {
const ticks = [];
const MIN_SPACING = 1e-14;
const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;
const unit = step || 1;
Slider
has 14 functions (exceeds 10 allowed). Consider refactoring. Open
class Slider extends AbstractRenderer
{
/**
* The Data role, used for Javascript mapping of slider Widget
*
Function _onPropertyChange
has 80 lines of code (exceeds 40 allowed). Consider refactoring. Open
_onPropertyChange: _.debounce(function () {
var searchField = this.element,
clonePosition = {
position: 'absolute',
// Removed to fix display issues
Function stringToBoolConverting
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function stringToBoolConverting($data, array $stringToBoolInputs = null)
{
if (null === $stringToBoolInputs) {
$stringToBoolInputs = $this->stringToBoolInputs;
}
- 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 modifyAggregations
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function modifyAggregations($storeId, $requestName, $aggregations, $query, $filters, $queryFilters)
{
if ($this->sliderHelper->isAdaptiveSliderEnabled()) {
foreach ($this->applicableAttributes as $attribute) {
$field = $this->requestFieldMapper->getMappedFieldName($attribute->getAttributeCode());
- 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 buildAggregations
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function buildAggregations(array $buckets = [])
{
$aggregations = [];
foreach ($buckets as $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
ContainerConfiguration
has 13 functions (exceeds 10 allowed). Consider refactoring. Open
class ContainerConfiguration implements ContainerConfigurationInterface
{
/**
* @var string
*/
Mapping
has 13 functions (exceeds 10 allowed). Consider refactoring. Open
class Mapping implements MappingInterface
{
/**
* @var string
*/
Collection
has 13 functions (exceeds 10 allowed). Consider refactoring. Open
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
/**
* Store for filter
*
Url
has 13 functions (exceeds 10 allowed). Consider refactoring. Open
class Url
{
/**
* XML path for product url suffix
*/
Function getSubtreeBreadcrumbPath
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function getSubtreeBreadcrumbPath($helper, $appliedRoot)
{
if (!$this->categoryPath) {
$path = [];
$category = $helper->getCategory();
- 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
Preview
has 12 functions (exceeds 10 allowed). Consider refactoring. Open
class Preview extends Action
{
/**
* @var \Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\PreviewFactory
*/
Product
has 12 functions (exceeds 10 allowed). Consider refactoring. Open
class Product extends \Magento\Rule\Model\Condition\Product\AbstractProduct
{
/**
* @var AttributeList
*/
Condition
has 12 functions (exceeds 10 allowed). Consider refactoring. Open
class Condition extends AbstractSimpleObject implements ConditionInterface
{
const KEY_CONDITION_TYPE = 'condition_type';
const KEY_CONDITIONS = 'conditions';
const KEY_AGGREGATOR_TYPE = 'aggregator_type';