qlik-oss/sn-scatter-plot

View on GitHub

Showing 190 of 199 total issues

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

    if (nav.y + nav.height >= point.height * RATIO) {
      if (nav.y >= point.height * RATIO) {
        nav.y = point.height * RATIO;
        nav.height = 0;
      } else {
src/picasso-definition/components/mini-chart/navigation-window.js on lines 31..38

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 88.

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 (nav.x + nav.width >= point.width * RATIO) {
      if (nav.x >= point.width * RATIO) {
        nav.x = point.width * RATIO;
        nav.width = 0;
      } else {
src/picasso-definition/components/mini-chart/navigation-window.js on lines 52..59

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 88.

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

Function render has 98 lines of code (exceeds 60 allowed). Consider refactoring.
Open

  render() {
    const { scale, rect, symbol } = this;
    const labels = labelHelper.resolveLabels(this.settings.labels);
    if (scale.domain().length <= 0 || labels.length <= 0) {
      return false;
Severity: Major
Found in src/picasso-components/ref-line-labels/index.js - About 2 hrs to fix

    Function render has 96 lines of code (exceeds 60 allowed). Consider refactoring.
    Open

      render() {
        const DY = DISTANCE - 1;
        const { settings } = this.settings;
        const { target, label, showLabel, mode, debugMode, maxVisibleBubblesForLabeling } = settings;
        const key = target.point;
    Severity: Major
    Found in src/picasso-components/point-label/index.js - About 2 hrs to fix

      Function qBrush has 95 lines of code (exceeds 60 allowed). Consider refactoring.
      Open

      export default function qBrush(brush, layout, opts = {}) {
        const selections = [];
        const methods = {};
        const isActive = brush.isActive();
        let hasValues = false;
      Severity: Major
      Found in src/services/selection-service/bin-selection/q-brush.js - About 2 hrs to fix

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

            if (nav.y <= 0) {
              if (nav.y + nav.height <= 0) {
                nav.height = 0;
              } else {
                nav.height += nav.y;
        src/picasso-definition/components/mini-chart/navigation-window.js on lines 20..28

        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 83.

        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

        Function r has 95 lines of code (exceeds 60 allowed). Consider refactoring.
        Open

        export default function r() {
          const isNotNumber = (x) => typeof x !== 'number' || Number.isNaN(x);
          function createRendererBox({ x, y, width, height, scaleRatio, margin } = {}) {
            const box = {
              x: 0,
        Severity: Major
        Found in src/picasso-components/react-components/react-renderer.js - About 2 hrs to fix

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

              if (nav.x <= 0) {
                if (nav.x + nav.width <= 0) {
                  nav.width = 0;
                } else {
                  nav.width += nav.x;
          src/picasso-definition/components/mini-chart/navigation-window.js on lines 41..49

          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 83.

          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

          Function resolveExtrema has 95 lines of code (exceeds 60 allowed). Consider refactoring.
          Open

            function resolveExtrema(scaleName) {
              // Choose between data min/max and explicit min/max. Explicit values have higher priority
              const measurePath = scaleName === KEYS.SCALE.X ? 'qMeasureInfo.0' : 'qMeasureInfo.1';
              const measureIndex = scaleName === KEYS.SCALE.X ? 0 : 1;
              let minFromLayout = layoutService.getHyperCubeValue(`${measurePath}.qMin`, 0);
          Severity: Major
          Found in src/models/extremum-model/index.js - About 2 hrs to fix

            File text-helper.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            let dummyContext;
            
            function setDummyContext() {
              dummyContext = dummyContext || document.createElement('canvas').getContext('2d');
            }
            Severity: Minor
            Found in src/utils/text-helper.js - About 2 hrs to fix

              Function objectDefinition has 89 lines of code (exceeds 60 allowed). Consider refactoring.
              Open

              const objectDefinition = () => {
                /**
                 * @lends properties
                 */
                const definition = {
              Severity: Major
              Found in src/qae/object-definition.js - About 2 hrs to fix

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

                              {
                                qMeasureIx: yRange.idx,
                                qRange: {
                                  qMin: yRange.range.min,
                                  qMax: yRange.range.max,
                Severity: Major
                Found in src/services/selection-service/bin-selection/q-brush.js and 1 other location - About 2 hrs to fix
                src/services/selection-service/bin-selection/q-brush.js on lines 86..94

                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 77.

                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

                              {
                                qMeasureIx: xRange.idx,
                                qRange: {
                                  qMin: xRange.range.min,
                                  qMax: xRange.range.max,
                Severity: Major
                Found in src/services/selection-service/bin-selection/q-brush.js and 1 other location - About 2 hrs to fix
                src/services/selection-service/bin-selection/q-brush.js on lines 95..103

                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 77.

                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

                Function createMiniChartPoints has 86 lines of code (exceeds 60 allowed). Consider refactoring.
                Open

                export default function createMiniChartPoints(chartModel, rtl) {
                  const { RATIO, PADDING } = NUMBERS.MINI_CHART; // Padding from the bottom right corner
                
                  // Padding, normalized to chart size
                  const padding = { x: 0, y: 0 };
                Severity: Major
                Found in src/picasso-definition/components/mini-chart/mini-points.js - About 2 hrs to fix

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

                    return {
                      orientation: 'horizontal',
                      majorAxis: 'x',
                      majorDimension: 'width',
                      majorSize: rect.width,
                  Severity: Major
                  Found in src/picasso-components/ref-line-labels/internal/area.js and 1 other location - About 2 hrs to fix
                  src/picasso-components/ref-line-labels/internal/area.js on lines 5..13

                  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

                      return {
                        orientation: 'vertical',
                        majorAxis: 'y',
                        majorDimension: 'height',
                        majorSize: rect.height,
                  Severity: Major
                  Found in src/picasso-components/ref-line-labels/internal/area.js and 1 other location - About 2 hrs to fix
                  src/picasso-components/ref-line-labels/internal/area.js on lines 14..22

                  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

                      const renderedLowerOobs = oob.createOobs({
                        alignment: 0,
                        dockValue: 0,
                        oobs: lowerOobs,
                        style: style.oob,
                  Severity: Major
                  Found in src/picasso-components/ref-line-labels/index.js and 1 other location - About 1 hr to fix
                  src/picasso-components/ref-line-labels/index.js on lines 144..155

                  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 74.

                  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

                      const renderedUpperOobs = oob.createOobs({
                        alignment: 1,
                        dockValue: 1,
                        oobs: upperOobs,
                        style: style.oob,
                  Severity: Major
                  Found in src/picasso-components/ref-line-labels/index.js and 1 other location - About 1 hr to fix
                  src/picasso-components/ref-line-labels/index.js on lines 132..143

                  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 74.

                  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

                  Function getStylingItems has 82 lines of code (exceeds 60 allowed). Consider refactoring.
                  Open

                  const getStylingItems = (flags, translator, theme) => {
                    const items = {};
                    const fontResolver = createFontResolver({
                      theme,
                      translator,

                    Function disclaimer has 80 lines of code (exceeds 60 allowed). Consider refactoring.
                    Open

                    export default function disclaimer() {
                      class DisclaimerComponent extends React.Component {
                        render() {
                          const { label, spanStyle } = this.props;
                    
                    
                    Severity: Major
                    Found in src/picasso-components/react-components/disclaimer.jsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language