Showing 607 of 1,357 total issues
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$field,
array $metrics = [],
array $childBuckets = [],
array $pipelines = [],
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$field,
array $metrics = [],
array $childBuckets = [],
array $pipelines = [],
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
array $fields,
$like,
$minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
$boostTerms = self::DEFAULT_BOOST_TERMS,
$minTermFreq = self::DEFAULT_MIN_TERM_FREQ,
Function updateAttributeData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function updateAttributeData($attribute, $rowData)
{
$dataChanged = false;
foreach ($rowData as $key => $value) {
- 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 prepareFieldCondition
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function prepareFieldCondition(FieldInterface $field, $condition, $currentPath)
{
$queryType = QueryInterface::TYPE_TERMS;
$condition = $this->prepareCondition($condition);
- 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 processNestedGroups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function processNestedGroups($group)
{
$data = [];
if (isset($group['fields']) && is_array($group['fields'])) {
- 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 buildSordOrders
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function buildSordOrders(ContainerConfigurationInterface $containerConfig, array $orders)
{
$sortOrders = [];
$mapping = $containerConfig->getMapping();
- 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 saveTermsRelation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function saveTermsRelation(\Magento\Framework\Model\AbstractModel $object)
{
$termRelations = $object->getTermsRelations() ?? [];
$termRelations = array_filter($termRelations);
- 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 getFilterArray
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function getFilterArray(array $request, \Magento\Catalog\Model\Product $product)
{
$filterArray = [];
$attributes = $this->eavConfig->getEntityAttributes(\Magento\Catalog\Model\Product::ENTITY, $product);
- 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 constructor
has 54 lines of code (exceeds 40 allowed). Consider refactoring. Open
constructor(item, config) {
const me = this;
this.config = config = new Config(config);
const initialCanvas = getCanvas(item);
const existingChart = getChart(initialCanvas);
Function _calculateBarValuePixels
has 54 lines of code (exceeds 40 allowed). Consider refactoring. Open
_calculateBarValuePixels(index) {
const me = this;
const {vScale, _stacked} = me._cachedMeta;
const {base: baseValue, minBarLength} = me.options;
const parsed = me.getParsed(index);
Function beforeElementsUpdate
has 54 lines of code (exceeds 40 allowed). Consider refactoring. Open
beforeElementsUpdate: (chart, args, options) => {
if (!options.enabled) {
cleanDecimatedData(chart);
return;
}
Method afterCreateCollection
has 53 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function afterCreateCollection(ProductsList $subject, $collection)
{
$storeId = $this->getCurrentStoreId($subject);
$sortOption = $subject->getData('sort_order');
$conditionOption = $subject->getData('condition_option');
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$indexName,
QueryInterface $query,
QueryInterface $filter = null,
array $sortOrders = null,
Function getDataSets
has 52 lines of code (exceeds 40 allowed). Consider refactoring. Open
getDataSets: function (optionValue) {
optionValue = this.currentOptionValue;
var datasets = [];
var DataSetsConfig = {
'ln1p': {
Function success
has 52 lines of code (exceeds 40 allowed). Consider refactoring. Open
success: $.proxy(function (data) {
var self = this;
var lastElement = false;
var content = this._getResultWrapper();
var sectionDropdown = this._getSectionHeader();
Method execute
has 52 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function execute()
{
// Prepare product attributes grid collection.
$attributeCollectionFactory = $this->attributeCollectionFactory->create();
$attributeCollection = $attributeCollectionFactory->addVisibleFilter()
Method addFacetFields
has 52 lines of code (exceeds 40 allowed). Consider refactoring. Open
private function addFacetFields(Fieldset $fieldset)
{
$fieldset->addField(
'facet_min_coverage_rate',
'text',
Function minMaxDecimation
has 51 lines of code (exceeds 40 allowed). Consider refactoring. Open
function minMaxDecimation(data, start, count, availableWidth) {
let avgX = 0;
let countX = 0;
let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;
const decimated = [];
Function getTooltipSize
has 51 lines of code (exceeds 40 allowed). Consider refactoring. Open
function getTooltipSize(tooltip, options) {
const ctx = tooltip._chart.ctx;
const {body, footer, title} = tooltip;
const {boxWidth, boxHeight} = options;
const bodyFont = toFont(options.bodyFont);