Showing 620 of 1,375 total issues
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 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 addFacetFields
has 52 lines of code (exceeds 40 allowed). Consider refactoring. Open
private function addFacetFields(Fieldset $fieldset)
{
$fieldset->addField(
'facet_min_coverage_rate',
'text',
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()
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 bindAttributeInputType
has 51 lines of code (exceeds 40 allowed). Consider refactoring. Open
bindAttributeInputType: function () {
this.checkOptionsPanelVisibility();
this.switchDefaultValueField();
var filterableFrontendInputs = $.merge(this.selectFields, ['text', 'boolean']);
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);
Method getLanguageConfiguration
has 51 lines of code (exceeds 40 allowed). Consider refactoring. Open
private function getLanguageConfiguration(\DOMXPath $xpath, $language, array $defaultConfig)
{
$languageCharFilters = $this->parseFilters(
$xpath,
self::CHAR_FILTER_TYPE_ROOT_NODE,
Method build
has 51 lines of code (exceeds 40 allowed). Consider refactoring. Open
public function build(AggregationInterface $aggregation, ?int $storeId): array
{
$bucket = $aggregation->getBucket(self::CATEGORY_BUCKET);
if ($this->isBucketEmpty($bucket)) {
Function getInputType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getInputType()
{
$inputType = 'string';
$selectAttributes = ['attribute_set_id'];
- 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 aroundExecute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function aroundExecute(
\Magento\CatalogSearch\Controller\Result\Index $subject,
\Closure $proceed
) {
$result = $proceed();
- 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 modifyAttributes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function modifyAttributes($storeId, $requestName, $attributes, $query, $filters, $queryFilters)
{
$relevantAttributes = [];
$coverageRates = $this->getCoverageRates($storeId, $requestName, $query, $filters, $queryFilters);
- 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 modifyData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function modifyData(array $data)
{
$optimizer = $this->locator->getOptimizer();
if ($optimizer && $optimizer->getId() && isset($data[$optimizer->getId()])) {
- 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 getMetrics
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getMetrics($rawValue)
{
$metrics = [];
foreach ($rawValue as $metricName => $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 getGroupsForSave
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getGroupsForSave()
{
$groups = $this->getRequest()->getPost('groups');
$files = $this->getRequest()->getFiles('groups');
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
- 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"