qlik-oss/sn-scatter-plot

View on GitHub

Showing 190 of 199 total issues

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

      title: {
        getStyle: () => ({
          fontFamily: overrides('legend')?.legend?.title?.fontFamily ?? styles.legend.title.fontFamily,
          fontSize: overrides('legend')?.legend?.title?.fontSize ?? styles.legend.title.fontSize,
          color: overrides('legend')?.legend?.title?.color?.color ?? styles.legend.title.color,
Severity: Major
Found in src/models/style-model/index.js and 2 other locations - About 4 hrs to fix
src/models/style-model/index.js on lines 20..26
src/models/style-model/index.js on lines 50..56

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

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 3 locations. Consider refactoring.
Open

      title: {
        getStyle: () => ({
          fontFamily: overrides('axis')?.axis?.title?.fontFamily ?? styles.axis.title.fontFamily,
          fontSize: overrides('axis')?.axis?.title?.fontSize ?? styles.axis.title.fontSize,
          color: overrides('axis')?.axis?.title?.color?.color ?? styles.axis.title.color,
Severity: Major
Found in src/models/style-model/index.js and 2 other locations - About 4 hrs to fix
src/models/style-model/index.js on lines 43..49
src/models/style-model/index.js on lines 50..56

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

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 3 locations. Consider refactoring.
Open

      label: {
        getStyle: () => ({
          fontFamily: overrides('legend')?.legend?.label?.fontFamily ?? styles.legend.label.fontFamily,
          fontSize: overrides('legend')?.legend?.label?.fontSize ?? styles.legend.label.fontSize,
          color: overrides('legend')?.legend?.label?.color?.color ?? styles.legend.label.color,
Severity: Major
Found in src/models/style-model/index.js and 2 other locations - About 4 hrs to fix
src/models/style-model/index.js on lines 20..26
src/models/style-model/index.js on lines 43..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 130.

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

      test('Select by point ', async () => {
        const renderUrl = await route.renderFixture('scatter_render_tooltip.fix.js');
        // Open page in Nebula which renders fixture
        // render svg added to the fix.js
        const browser = await chromium.launch();
Severity: Major
Found in test/integration/index.spec.js and 1 other location - About 4 hrs to fix
test/integration/index.spec.js on lines 150..160

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

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

      test('Select bin ', async () => {
        const renderUrl = await route.renderFixture('scatter_render_binned_snapshot_tooltip.fix.js');
        // Open page in Nebula which renders fixture
        // render svg added to the fix.js
        const browser = await chromium.launch();
Severity: Major
Found in test/integration/index.spec.js and 1 other location - About 4 hrs to fix
test/integration/index.spec.js on lines 61..71

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

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

File index.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-param-reassign */
import extend from 'extend';
import KEYS from '../../constants/keys';
import NUMBERS from '../../constants/numbers';
import createViewHandler from '../../view-handler';
Severity: Minor
Found in src/models/chart-model/index.js - About 4 hrs to fix

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

    export default function getPointXLineDistance(p, p1, p2) {
      const dx2 = (p.x - p1.x) ** 2;
      if (p2.y < p.y) {
        return (p2.y - p.y) ** 2 + dx2;
      }
    Severity: Major
    Found in src/utils/math/point-x-line-distance.js and 1 other location - About 4 hrs to fix
    src/utils/math/point-y-line-distance.js on lines 2..11

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

    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

    export default function getPointYLineDistance(p, p1, p2) {
      const dy2 = (p.y - p1.y) ** 2;
      if (p2.x < p.x) {
        return (p2.x - p.x) ** 2 + dy2;
      }
    Severity: Major
    Found in src/utils/math/point-y-line-distance.js and 1 other location - About 4 hrs to fix
    src/utils/math/point-x-line-distance.js on lines 2..11

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

    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

    export default function getPointRectXDistance(p, rect) {
      const { x1, x2, y1, y2 } = rect;
      const closestY = Math.abs(y1 - p.y) < Math.abs(y2 - p.y) ? y1 : y2;
    
      return getPointYLineDistance(p, { x: x1, y: closestY }, { x: x2, y: closestY });
    Severity: Major
    Found in src/utils/math/point-rect-y-distance.js and 1 other location - About 4 hrs to fix
    src/utils/math/point-rect-x-distance.js on lines 3..8

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

    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

    export default function getPointRectXDistance(p, rect) {
      const { x1, x2, y1, y2 } = rect;
      const closestX = Math.abs(x1 - p.x) < Math.abs(x2 - p.x) ? x1 : x2;
    
      return getPointXLineDistance(p, { x: closestX, y: y1 }, { x: closestX, y: y2 });
    Severity: Major
    Found in src/utils/math/point-rect-x-distance.js and 1 other location - About 4 hrs to fix
    src/utils/math/point-rect-y-distance.js on lines 3..8

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

    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

    File utils.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import rtlUtils from '../utils/rtl-utils';
    import TOOLTIP from './constants';
    import customTooltipPromises from './promises';
    import tooltipChart from './chart/index';
    
    
    Severity: Minor
    Found in src/custom-tooltip/utils.js - About 3 hrs to fix

      Function createExtremumModel has 123 lines of code (exceeds 60 allowed). Consider refactoring.
      Open

      export default function createExtremumModel(layoutService, viewStateOptions = {}) {
        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;
      Severity: Major
      Found in src/models/extremum-model/index.js - About 3 hrs to fix

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

            render() {
              const { titleData, popover, translator, disabled, isDimension, padding, minWidth, hasAlternative } = this.props;
              const textStyle = {
                flex: '1 1 auto',
                overflow: 'hidden',
        Severity: Major
        Found in src/picasso-components/react-components/data-title-component.jsx - About 3 hrs to fix

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

              const rects1 =
                mode === 2 || !debugMode
                  ? []
                  : topLabels.map((node) => ({
                      type: 'rect',
          Severity: Major
          Found in src/picasso-components/point-label/index.js and 1 other location - About 3 hrs to fix
          src/picasso-components/point-label/index.js on lines 112..123

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

          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 rects2 =
                mode === 2 || !debugMode
                  ? []
                  : bottomLabels.map((node) => ({
                      type: 'rect',
          Severity: Major
          Found in src/picasso-components/point-label/index.js and 1 other location - About 3 hrs to fix
          src/picasso-components/point-label/index.js on lines 78..89

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

          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

                this.area = chart
                  .componentsFromPoint({ x: e.center.x, y: e.center.y })
                  .filter((c) => c.key === KEYS.COMPONENT.POINT || c.key === KEYS.COMPONENT.HEAT_MAP);
          Severity: Major
          Found in src/picasso-definition/interactions/pinch.js and 1 other location - About 2 hrs to fix
          src/picasso-definition/interactions/pan.js on lines 62..64

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

          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

                this.area = chart
                  .componentsFromPoint({ x: e.center.x, y: e.center.y })
                  .filter((c) => c.key === KEYS.COMPONENT.POINT || c.key === KEYS.COMPONENT.HEAT_MAP);
          Severity: Major
          Found in src/picasso-definition/interactions/pan.js and 1 other location - About 2 hrs to fix
          src/picasso-definition/interactions/pinch.js on lines 33..35

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

          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 labels1 = topLabels.map((node) => ({
                type: 'text',
                text: node.ellipsed,
                x: node.cx,
                y: node.topRect.y2,
          Severity: Major
          Found in src/picasso-components/point-label/index.js and 1 other location - About 2 hrs to fix
          src/picasso-components/point-label/index.js on lines 100..111

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

          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 labels2 = bottomLabels.map((node) => ({
                type: 'text',
                text: node.ellipsed,
                x: node.cx,
                y: node.bottomRect.y1,
          Severity: Major
          Found in src/picasso-components/point-label/index.js and 1 other location - About 2 hrs to fix
          src/picasso-components/point-label/index.js on lines 66..77

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

          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 exploreDefinition has 102 lines of code (exceeds 60 allowed). Consider refactoring.
          Open

          export default function exploreDefinition() {
            return {
              type: 'items',
              component: 'accordion',
              items: {
          Severity: Major
          Found in src/ext/explore-definition/index.js - About 2 hrs to fix
            Severity
            Category
            Status
            Source
            Language