Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js

Summary

Maintainability
F
2 mos
Test Coverage

File chart.js has 12846 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Chart.js v3.3.2
 * https://www.chartjs.org
 * (c) 2021 Chart.js Contributors
 * Released under the MIT License
Severity: Major
Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 mo to fix

    Function _computeLabelItems has 139 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

            _computeLabelItems(chartArea) {
                const me = this;
                const axis = me.axis;
                const options = me.options;
                const {position, ticks: optionTicks} = options;
    Severity: Major
    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 4 hrs to fix

      Function _draw has 116 lines of code (exceeds 40 allowed). Consider refactoring.
      Open

              _draw() {
                  const me = this;
                  const {options: opts, columnSizes, lineWidths, ctx} = me;
                  const {align, labels: labelOpts} = opts;
                  const defaultColor = defaults.color;
      Severity: Major
      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 4 hrs to fix

        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;
        Severity: Major
        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 3 hrs to fix

          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;
          Severity: Major
          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 3 hrs to fix

            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;
            Severity: Major
            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 2 hrs to fix

              Function fitWithPointLabels has 71 lines of code (exceeds 40 allowed). Consider refactoring.
              Open

                  function fitWithPointLabels(scale) {
                      const furthestLimits = {
                          l: 0,
                          r: scale.width,
                          t: 0,
              Severity: Major
              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 2 hrs to fix

                Function _drawColorBox has 63 lines of code (exceeds 40 allowed). Consider refactoring.
                Open

                        _drawColorBox(ctx, pt, i, rtlHelper, options) {
                            const me = this;
                            const labelColors = me.labelColors[i];
                            const labelPointStyle = me.labelPointStyles[i];
                            const {boxHeight, boxWidth} = options;
                Severity: Major
                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                  Function update has 58 lines of code (exceeds 40 allowed). Consider refactoring.
                  Open

                          update(chart, width, height, minPadding) {
                              if (!chart) {
                                  return;
                              }
                              const padding = toPadding(chart.options.layout.padding);
                  Severity: Major
                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                    Function buildOrUpdateScales has 57 lines of code (exceeds 40 allowed). Consider refactoring.
                    Open

                            buildOrUpdateScales() {
                                const me = this;
                                const options = me.options;
                                const scaleOpts = options.scales;
                                const scales = me.scales;
                    Severity: Major
                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                      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);
                      Severity: Major
                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                        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);
                        Severity: Major
                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                          Function beforeElementsUpdate has 54 lines of code (exceeds 40 allowed). Consider refactoring.
                          Open

                                  beforeElementsUpdate: (chart, args, options) => {
                                      if (!options.enabled) {
                                          cleanDecimatedData(chart);
                                          return;
                                      }
                          Severity: Major
                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                            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);
                            Severity: Major
                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                              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 = [];
                              Severity: Major
                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                Function renderText has 49 lines of code (exceeds 40 allowed). Consider refactoring.
                                Open

                                    function renderText(ctx, text, x, y, font, opts = {}) {
                                        const lines = isArray(text) ? text : [text];
                                        const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';
                                        let i, line;
                                        ctx.save();
                                Severity: Minor
                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                  Function update has 49 lines of code (exceeds 40 allowed). Consider refactoring.
                                  Open

                                          update(maxWidth, maxHeight, margins) {
                                              const me = this;
                                              const tickOpts = me.options.ticks;
                                              const sampleSize = tickOpts.sampleSize;
                                              me.beforeUpdate();
                                  Severity: Minor
                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                    Function constructor has 48 lines of code (exceeds 40 allowed). Consider refactoring.
                                    Open

                                            constructor(cfg) {
                                                super();
                                                this.id = cfg.id;
                                                this.type = cfg.type;
                                                this.options = undefined;
                                    Severity: Minor
                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                      Function lttbDecimation has 44 lines of code (exceeds 40 allowed). Consider refactoring.
                                      Open

                                          function lttbDecimation(data, start, count, availableWidth, options) {
                                              const samples = options.samples || availableWidth;
                                              if (samples >= count) {
                                                  return data.slice(start, start + count);
                                              }
                                      Severity: Minor
                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                        Function drawLegendBox has 44 lines of code (exceeds 40 allowed). Consider refactoring.
                                        Open

                                                    const drawLegendBox = function(x, y, legendItem) {
                                                        if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {
                                                            return;
                                                        }
                                                        ctx.save();
                                        Severity: Minor
                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                          Function drawGrid has 44 lines of code (exceeds 40 allowed). Consider refactoring.
                                          Open

                                                  drawGrid(chartArea) {
                                                      const me = this;
                                                      const grid = me.options.grid;
                                                      const ctx = me.ctx;
                                                      const items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));
                                          Severity: Minor
                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                            Function fastPathSegment has 43 lines of code (exceeds 40 allowed). Consider refactoring.
                                            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;
                                            Severity: Minor
                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                              Function update has 43 lines of code (exceeds 40 allowed). Consider refactoring.
                                              Open

                                                      update(changed, replay) {
                                                          const me = this;
                                                          const options = me.options.setContext(me.getContext());
                                                          const active = me._active;
                                                          let properties;
                                              Severity: Minor
                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                Function update has 43 lines of code (exceeds 40 allowed). Consider refactoring.
                                                Open

                                                        update(mode) {
                                                            const me = this;
                                                            const config = me.config;
                                                            config.update();
                                                            me._options = config.createResolver(config.chartOptionScopes(), me.getContext());
                                                Severity: Minor
                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                  Function _getYAxisLabelAlignment has 43 lines of code (exceeds 40 allowed). Consider refactoring.
                                                  Open

                                                          _getYAxisLabelAlignment(tl) {
                                                              const me = this;
                                                              const {position, ticks: {crossAlign, mirror, padding}} = me.options;
                                                              const labelSizes = me._getLabelSizes();
                                                              const tickAndPadding = tl + padding;
                                                  Severity: Minor
                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                    Function drawBody has 42 lines of code (exceeds 40 allowed). Consider refactoring.
                                                    Open

                                                            drawBody(pt, ctx, options) {
                                                                const me = this;
                                                                const {body} = me;
                                                                const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth} = options;
                                                                const bodyFont = toFont(options.bodyFont);
                                                    Severity: Minor
                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                      Function _computeLabelSizes has 42 lines of code (exceeds 40 allowed). Consider refactoring.
                                                      Open

                                                              _computeLabelSizes(ticks, length) {
                                                                  const {ctx, _longestTextCache: caches} = this;
                                                                  const widths = [];
                                                                  const heights = [];
                                                                  let widestLabelSize = 0;
                                                      Severity: Minor
                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                        Function updateElements has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                                                        Open

                                                                updateElements(arcs, start, count, mode) {
                                                                    const me = this;
                                                                    const reset = mode === 'reset';
                                                                    const chart = me.chart;
                                                                    const dataset = me.getDataset();
                                                        Severity: Minor
                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                          Function pathArc has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                                                          Open

                                                              function pathArc(ctx, element, offset, end) {
                                                                  const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;
                                                                  const outerRadius = Math.max(element.outerRadius + offset - pixelMargin, 0);
                                                                  const innerRadius = innerR > 0 ? innerR + offset + pixelMargin : 0;
                                                                  const alpha = end - start;
                                                          Severity: Minor
                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                            Function getCaretPosition has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                                                            Open

                                                                    getCaretPosition(tooltipPoint, size, options) {
                                                                        const {xAlign, yAlign} = this;
                                                                        const {cornerRadius, caretSize} = options;
                                                                        const {x: ptX, y: ptY} = tooltipPoint;
                                                                        const {width, height} = size;
                                                            Severity: Minor
                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                              Function fit has 41 lines of code (exceeds 40 allowed). Consider refactoring.
                                                              Open

                                                                      fit() {
                                                                          const me = this;
                                                                          const minSize = {
                                                                              width: 0,
                                                                              height: 0
                                                              Severity: Minor
                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 1 hr to fix

                                                                Function renderText has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                    function renderText(ctx, text, x, y, font, opts = {}) {
                                                                Severity: Minor
                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 45 mins to fix

                                                                  Function optimizedEvaluateItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                  Open

                                                                      function optimizedEvaluateItems(chart, axis, position, handler, intersect) {
                                                                  Severity: Minor
                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                    Function _measureText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                        function _measureText(ctx, data, gc, longest, string) {
                                                                    Severity: Minor
                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                      Function _createResolver has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                          function _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {
                                                                      Severity: Minor
                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                        Function _steppedLineTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                        Open

                                                                            function _steppedLineTo(ctx, previous, target, flip, mode) {
                                                                        Severity: Minor
                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                          Function lttbDecimation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                          Open

                                                                              function lttbDecimation(data, start, count, availableWidth, options) {
                                                                          Severity: Minor
                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                            Function skip has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                            Open

                                                                                function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
                                                                            Severity: Minor
                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                              Function getNearestItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                              Open

                                                                                  function getNearestItems(chart, position, axis, intersect, useFinalPosition) {
                                                                              Severity: Minor
                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                                Function determineUnitForFormatting has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                Open

                                                                                    function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
                                                                                Severity: Minor
                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                                  Function _updateBezierControlPoints has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                  Open

                                                                                      function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
                                                                                  Severity: Minor
                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                                    Function determineLimits has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                    Open

                                                                                        function determineLimits(angle, pos, size, min, max) {
                                                                                    Severity: Minor
                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 35 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                              return false;
                                                                                      Severity: Minor
                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                    return target;
                                                                                        Severity: Minor
                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return false;
                                                                                          Severity: Major
                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                    return {lo: 0, hi: data.length - 1};
                                                                                            Severity: Minor
                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                      return false;
                                                                                              Severity: Minor
                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                    return;
                                                                                                Severity: Minor
                                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                                              return labels[item.dataIndex];
                                                                                                  Severity: Minor
                                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                            return true;
                                                                                                    Severity: Minor
                                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return true;
                                                                                                      Severity: Minor
                                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                return diff;
                                                                                                        Severity: Minor
                                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                      return true;
                                                                                                          Severity: Minor
                                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                            return {top: me.top, left: 0, bottom: me.bottom, right: chart.width};
                                                                                                            Severity: Minor
                                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                      return _createResolver([...set], [''], rootScopes, fallback,
                                                                                                                          () => subGetTarget(resolver, prop, value));
                                                                                                              Severity: Minor
                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                            return height ? width / height : null;
                                                                                                                Severity: Minor
                                                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                          return +value;
                                                                                                                  Severity: Minor
                                                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                            return splitByStyles(solidSegments(points, start, max, completeLoop), points, segmentOptions);
                                                                                                                    Severity: Minor
                                                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                              return ['origin', 'start', 'end', 'stack'].indexOf(fill) >= 0 && fill;
                                                                                                                      Severity: Minor
                                                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                    return boundary;
                                                                                                                        Severity: Minor
                                                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                  return 'center';
                                                                                                                          Severity: Minor
                                                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                    return {
                                                                                                                                        start: pos,
                                                                                                                                        end: pos + size
                                                                                                                                    };
                                                                                                                            Severity: Minor
                                                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                          return (value - me.min) * scalingFactor;
                                                                                                                              Severity: Minor
                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                                return m * (t -= (2.25 / d)) * t + 0.9375;
                                                                                                                                Severity: Minor
                                                                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                          return lineTo;
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                            return _pointInLine;
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                          return;
                                                                                                                                      Severity: Major
                                                                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                return fill;
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                              return '';
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                        return '';
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                              return false;
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                        return 'right';
                                                                                                                                                Severity: Minor
                                                                                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                              return (me._cache.data = me.normalize(timestamps));
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                                return m * (t -= (2.625 / d)) * t + 0.984375;
                                                                                                                                                    Severity: Minor
                                                                                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                              return options;
                                                                                                                                                      Severity: Minor
                                                                                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                return Math.max(spacing, 1);
                                                                                                                                                        Severity: Minor
                                                                                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                          return fill;
                                                                                                                                                          Severity: Minor
                                                                                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                    return newTicks;
                                                                                                                                                            Severity: Minor
                                                                                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                          return 0;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                            return new DomPlatform();
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                          return false;
                                                                                                                                                                  Severity: Minor
                                                                                                                                                                  Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                            return source;
                                                                                                                                                                    Severity: Minor
                                                                                                                                                                    Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                              return options;
                                                                                                                                                                      Severity: Minor
                                                                                                                                                                      Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                            return;
                                                                                                                                                                        Severity: Minor
                                                                                                                                                                        Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                  return createBoundaryLine(boundary, line);
                                                                                                                                                                          Severity: Minor
                                                                                                                                                                          Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                        return +raw;
                                                                                                                                                                            Severity: Minor
                                                                                                                                                                            Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js - About 30 mins to fix

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          legend: {
                                                                                                                                                                                              labels: {
                                                                                                                                                                                                  generateLabels(chart) {
                                                                                                                                                                                                      const data = chart.data;
                                                                                                                                                                                                      if (data.labels.length && data.datasets.length) {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 8021..8046

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 219.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          legend: {
                                                                                                                                                                                              labels: {
                                                                                                                                                                                                  generateLabels(chart) {
                                                                                                                                                                                                      const data = chart.data;
                                                                                                                                                                                                      if (data.labels.length && data.datasets.length) {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 8325..8350

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 219.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                      getFooter(tooltipItems, options) {
                                                                                                                                                                                          const me = this;
                                                                                                                                                                                          const {callbacks} = options;
                                                                                                                                                                                          const beforeFooter = callbacks.beforeFooter.apply(me, [tooltipItems]);
                                                                                                                                                                                          const footer = callbacks.footer.apply(me, [tooltipItems]);
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 10857..10868

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 155.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                      getTitle(context, options) {
                                                                                                                                                                                          const me = this;
                                                                                                                                                                                          const {callbacks} = options;
                                                                                                                                                                                          const beforeTitle = callbacks.beforeTitle.apply(me, [context]);
                                                                                                                                                                                          const title = callbacks.title.apply(me, [context]);
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 10893..10904

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 155.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (position === 'left') {
                                                                                                                                                                                              if (mirror) {
                                                                                                                                                                                                  textAlign = 'left';
                                                                                                                                                                                                  x = me.right + padding;
                                                                                                                                                                                              } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4793..4811

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 122.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'right') {
                                                                                                                                                                                              if (mirror) {
                                                                                                                                                                                                  textAlign = 'right';
                                                                                                                                                                                                  x = me.left + padding;
                                                                                                                                                                                              } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4777..4811

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 122.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (me.isHorizontal()) {
                                                                                                                                                                                              me.width = me.maxWidth;
                                                                                                                                                                                              me.left = 0;
                                                                                                                                                                                              me.right = me.width;
                                                                                                                                                                                          } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 9981..9989

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 100.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (me.isHorizontal()) {
                                                                                                                                                                                              me.width = me.maxWidth;
                                                                                                                                                                                              me.left = 0;
                                                                                                                                                                                              me.right = me.width;
                                                                                                                                                                                          } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4167..4175

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 100.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (opts.reverse) {
                                                                                                                                                                                              ticks.reverse();
                                                                                                                                                                                              me.start = me.max;
                                                                                                                                                                                              me.end = me.min;
                                                                                                                                                                                          } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 11794..11801

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 85.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (opts.reverse) {
                                                                                                                                                                                              ticks.reverse();
                                                                                                                                                                                              me.start = me.max;
                                                                                                                                                                                              me.end = me.min;
                                                                                                                                                                                          } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 11947..11954

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 85.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                              if (xAlign === 'left') {
                                                                                                                                                                                                  x1 = ptX;
                                                                                                                                                                                                  x2 = x1 - caretSize;
                                                                                                                                                                                                  y1 = y2 + caretSize;
                                                                                                                                                                                                  y3 = y2 - caretSize;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 11014..11024

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 99.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                              if (yAlign === 'top') {
                                                                                                                                                                                                  y1 = ptY;
                                                                                                                                                                                                  y2 = y1 - caretSize;
                                                                                                                                                                                                  x1 = x2 - caretSize;
                                                                                                                                                                                                  x3 = x2 + caretSize;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 10994..11004

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 99.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                              if (position === 'center') {
                                                                                                                                                                                                  borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
                                                                                                                                                                                              } else if (isObject(position)) {
                                                                                                                                                                                                  const positionAxisID = Object.keys(position)[0];
                                                                                                                                                                                                  const value = position[positionAxisID];
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4558..4564

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 73.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                              if (position === 'center') {
                                                                                                                                                                                                  borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);
                                                                                                                                                                                              } else if (isObject(position)) {
                                                                                                                                                                                                  const positionAxisID = Object.keys(position)[0];
                                                                                                                                                                                                  const value = position[positionAxisID];
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4546..4552

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 73.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                                  } else {
                                                                                                                                                                                                      const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;
                                                                                                                                                                                                      minSize.width = Math.min(me.maxWidth, minSize.width + labelWidth + tickPadding);
                                                                                                                                                                                                  }
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4291..4294

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 76.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                                  if (isHorizontal) {
                                                                                                                                                                                                      const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;
                                                                                                                                                                                                      minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);
                                                                                                                                                                                                  } else {
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4294..4297

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 76.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'bottom') {
                                                                                                                                                                                              borderValue = alignBorderValue(me.top);
                                                                                                                                                                                              y1 = chartArea.top;
                                                                                                                                                                                              y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;
                                                                                                                                                                                              ty1 = borderValue + axisHalfWidth;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4539..4569

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 75.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'right') {
                                                                                                                                                                                              borderValue = alignBorderValue(me.left);
                                                                                                                                                                                              x1 = chartArea.left;
                                                                                                                                                                                              x2 = alignBorderValue(chartArea.right) - axisHalfWidth;
                                                                                                                                                                                              tx1 = borderValue + axisHalfWidth;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4527..4569

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 75.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'left') {
                                                                                                                                                                                              borderValue = alignBorderValue(me.right);
                                                                                                                                                                                              tx1 = me.right - tl;
                                                                                                                                                                                              tx2 = borderValue - axisHalfWidth;
                                                                                                                                                                                              x1 = alignBorderValue(chartArea.left) + axisHalfWidth;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4521..4569

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 75.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (position === 'top') {
                                                                                                                                                                                              borderValue = alignBorderValue(me.bottom);
                                                                                                                                                                                              ty1 = me.bottom - tl;
                                                                                                                                                                                              ty2 = borderValue - axisHalfWidth;
                                                                                                                                                                                              y1 = alignBorderValue(chartArea.top) + axisHalfWidth;
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4533..4569

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 75.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (inAreaPrev) {
                                                                                                                                                                                              point.cp1x = capControlPoint(point.cp1x, area.left, area.right);
                                                                                                                                                                                              point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);
                                                                                                                                                                                          }
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 45 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 5416..5419

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 65.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (inAreaNext) {
                                                                                                                                                                                              point.cp2x = capControlPoint(point.cp2x, area.left, area.right);
                                                                                                                                                                                              point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);
                                                                                                                                                                                          }
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 45 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 5412..5415

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 65.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          next: {
                                                                                                                                                                                              x: current.x + fb * (next.x - previous.x),
                                                                                                                                                                                              y: current.y + fb * (next.y - previous.y)
                                                                                                                                                                                          }
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 40 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 5311..5314

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 64.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          previous: {
                                                                                                                                                                                              x: current.x - fa * (next.x - previous.x),
                                                                                                                                                                                              y: current.y - fa * (next.y - previous.y)
                                                                                                                                                                                          },
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 40 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 5315..5318

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 64.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          if (me.isHorizontal()) {
                                                                                                                                                                                              x1 = _alignPixel(chart, me.left, axisWidth) - axisWidth / 2;
                                                                                                                                                                                              x2 = _alignPixel(chart, me.right, lastLineWidth) + lastLineWidth / 2;
                                                                                                                                                                                              y1 = y2 = borderValue;
                                                                                                                                                                                          } else {
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 40 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4911..4915

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 64.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else {
                                                                                                                                                                                              y1 = _alignPixel(chart, me.top, axisWidth) - axisWidth / 2;
                                                                                                                                                                                              y2 = _alignPixel(chart, me.bottom, lastLineWidth) + lastLineWidth / 2;
                                                                                                                                                                                              x1 = x2 = borderValue;
                                                                                                                                                                                          }
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 40 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4907..4911

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 64.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'right') {
                                                                                                                                                                                              const ret = me._getYAxisLabelAlignment(tl);
                                                                                                                                                                                              textAlign = ret.textAlign;
                                                                                                                                                                                              x = ret.x;
                                                                                                                                                                                          } else if (axis === 'x') {
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 35 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4634..4660

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 41.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                                                                              Open

                                                                                                                                                                                          } else if (position === 'left') {
                                                                                                                                                                                              const ret = me._getYAxisLabelAlignment(tl);
                                                                                                                                                                                              textAlign = ret.textAlign;
                                                                                                                                                                                              x = ret.x;
                                                                                                                                                                                          } else if (position === 'right') {
                                                                                                                                                                              Severity: Minor
                                                                                                                                                                              Found in src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js and 1 other location - About 35 mins to fix
                                                                                                                                                                              src/module-elasticsuite-core/view/adminhtml/web/js/lib/chart.js on lines 4638..4660

                                                                                                                                                                              Duplicated Code

                                                                                                                                                                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                              Tuning

                                                                                                                                                                              This issue has a mass of 41.

                                                                                                                                                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                              Refactorings

                                                                                                                                                                              Further Reading

                                                                                                                                                                              Parsing error: Unexpected token ...
                                                                                                                                                                              Open

                                                                                                                                                                                                          ...data[intermediateIndex1],

                                                                                                                                                                              For more information visit Source: http://eslint.org/docs/rules/

                                                                                                                                                                              There are no issues that match your filters.

                                                                                                                                                                              Category
                                                                                                                                                                              Status