Showing 620 of 1,375 total issues
Function drawGrid
has 44 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
drawGrid(chartArea) {
const me = this;
const grid = me.options.grid;
const ctx = me.ctx;
const items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));
Function lttbDecimation
has 44 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
function lttbDecimation(data, start, count, availableWidth, options) {
const samples = options.samples || availableWidth;
if (samples >= count) {
return data.slice(start, start + count);
}
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
QueryInterface $searchQuery,
FulltextCollectionFactory $productCollectionFactory,
ItemDataFactory $previewItemFactory,
QueryFactory $queryFactory,
QueryBuilder $queryBuilder,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory,
\Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
\Magento\Framework\Serialize\SerializerInterface $serializer,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Context $context,
Registry $registry,
FormFactory $formFactory,
Factory $configFactory,
Structure $configStructure,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
RequestFactory $requestFactory,
DimensionFactory $dimensionFactory,
QueryBuilder $queryBuilder,
SortOrderBuilder $sortOrderBuilder,
AggregationBuilder $aggregationBuilder,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$queryText,
array $fields,
$minimumShouldMatch = self::DEFAULT_MINIMUM_SHOULD_MATCH,
$tieBreaker = self::DEFAULT_TIE_BREAKER,
$name = null,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$name,
$primaryFieldName,
$requestFieldName,
\Magento\Search\Model\ResourceModel\Query\CollectionFactory $collectionFactory,
\Magento\Framework\Locale\FormatInterface $localeFormat,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
CategoryInterface $category,
FulltextCollectionFactory $productCollectionFactory,
ItemDataFactory $previewItemFactory,
QueryFactory $queryFactory,
ContextInterface $searchContext,
Function _getYAxisLabelAlignment
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
_getYAxisLabelAlignment(tl) {
const me = this;
const {position, ticks: {crossAlign, mirror, padding}} = me.options;
const labelSizes = me._getLabelSizes();
const tickAndPadding = tl + padding;
Function _mouseDown
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
_mouseDown: function( event ) {
// don't let more than one widget handle mouseStart
if ( mouseHandled ) {
return;
Function fastPathSegment
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
function fastPathSegment(ctx, line, segment, params) {
const points = line.points;
const {count, start, ilen} = pathVars(points, segment, params);
const {move = true, reverse} = params || {};
let avgX = 0;
Function update
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
update(changed, replay) {
const me = this;
const options = me.options.setContext(me.getContext());
const active = me._active;
let properties;
Function update
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
update(mode) {
const me = this;
const config = me.config;
config.update();
me._options = config.createResolver(config.chartOptionScopes(), me.getContext());
Method checkUpdateNeeded
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
private function checkUpdateNeeded($subject)
{
$updateMapping = $cleanCache = $invalidateIndex = false;
if ($this->saveIsNew === true) {
Method getSuggestions
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
private function getSuggestions(string $queryText, int $maxSize = self::MAX_COUNT)
{
$suggestions = [];
$containerConfig = $this->getRequestContainerConfiguration(
$this->storeManager->getStore()->getId(),
Method parseAnalyzers
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
private function parseAnalyzers(
\DOMXPath $xpath,
array $availableCharFilters,
array $availableFilters,
$language = self::LANGUAGE_DEFAULT,
Method getSpanQuery
has 43 lines of code (exceeds 40 allowed). Consider refactoring. Open
Open
private function getSpanQuery(ContainerConfigurationInterface $containerConfig, $queryText, $boost)
{
$query = null;
$terms = explode(' ', $queryText);
Function getSearchQueryIdentities
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
private function getSearchQueryIdentities()
{
$identities = [];
$queryIds = [];
$origData = $this->optimizer->getOrigData();
- 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 apply
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function apply(\Magento\Framework\App\RequestInterface $request)
{
/**
* Filter must be string: $fromPrice-$toPrice
*/
- 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"