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

    rendererSettings: {
      transform,
      canvasBufferSize: (rect) => ({
        width: rect.computedPhysical.width + 100,
        height: rect.computedPhysical.height + 100,
Severity: Major
Found in src/picasso-definition/components/point-labels/index.js and 2 other locations - About 1 hr to fix
src/picasso-definition/components/heat-map-labels/index.js on lines 55..61
src/picasso-definition/components/heat-map/index.js on lines 70..76

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

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

export default function createCustomTooltipService({
  flags,
  layout,
  app,
  model,
Severity: Major
Found in src/custom-tooltip/service/index.js and 3 other locations - About 55 mins to fix
src/picasso-components/ref-line-labels/internal/oob.js on lines 62..111
src/picasso-definition/index.js on lines 10..73
src/services/tooltip-service/section/index.js on lines 5..152

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

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

export default function createSection({
  translator,
  custom,
  measureProperties,
  h,
Severity: Major
Found in src/services/tooltip-service/section/index.js and 3 other locations - About 55 mins to fix
src/custom-tooltip/service/index.js on lines 12..91
src/picasso-components/ref-line-labels/internal/oob.js on lines 62..111
src/picasso-definition/index.js on lines 10..73

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

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

  createOobs({ alignment, dockValue, oobs, style, rect, symbol, position, area, radius, font }) {
    const numOobs = oobs ? oobs.length : 0;
    if (numOobs < 1) {
      return [];
    }
Severity: Major
Found in src/picasso-components/ref-line-labels/internal/oob.js and 3 other locations - About 55 mins to fix
src/custom-tooltip/service/index.js on lines 12..91
src/picasso-definition/index.js on lines 10..73
src/services/tooltip-service/section/index.js on lines 5..152

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

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 tokenize has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  tokenize(text, font, ellipsis, maxNumLines, maxWidth, maxHeight, lineHeightMultiplicator = 1) {
Severity: Major
Found in src/utils/text-helper.js - About 50 mins to fix

    Function imageData has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export default function imageData(range, axis, dataView, dirtyImageData, width, height, rtl) {
    Severity: Major
    Found in src/picasso-components/heat-map-highlight/extract-image-data.js - About 50 mins to fix

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

              el.style.top = `${Math.round(rect.margin.top + rect.y * scaleY)}px`;
      Severity: Minor
      Found in src/picasso-components/react-components/react-renderer.js and 1 other location - About 50 mins to fix
      src/picasso-components/react-components/react-renderer.js on lines 73..73

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

      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

              el.style.left = `${Math.round(rect.margin.left + rect.x * scaleX)}px`;
      Severity: Minor
      Found in src/picasso-components/react-components/react-renderer.js and 1 other location - About 50 mins to fix
      src/picasso-components/react-components/react-renderer.js on lines 74..74

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

      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

      Avoid deeply nested control flow statements.
      Open

                  if (
                    textHelper.measureTextWidth(`${remainder} ${cLines[i + 1]}`) > width &&
                    result.length + cLines.length - i <= maxNumLines
                  ) {
                    // If adding to the next line will force that to break as well and we are not close to the max limit, then create a new line inbetween instead
      Severity: Major
      Found in src/utils/text-helper.js - About 45 mins to fix

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

        function changeTo(model, index, altIndex, listAttr, onChange, skipAttributeExpressions) {
        Severity: Minor
        Found in src/utils/data-title-utils.js - About 45 mins to fix

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

                compensateForLayoutChanges({ currentNodes, currentRect, previousRect }) {
                  const deltaX = currentRect.x - previousRect.x;
                  currentNodes.forEach((node) => {
                    node.x -= deltaX;
                  });
          Severity: Minor
          Found in src/picasso-definition/components/reference-lines/labels.js and 1 other location - About 45 mins to fix
          src/picasso-definition/components/reference-lines/lines.js on lines 52..57

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

          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 (currentRect.width !== previousRect.width) {
                        const deltaWidth = currentRect.width - previousRect.width;
                        currentNodes.forEach((node) => {
                          node.x2 += deltaWidth;
                        });
          Severity: Minor
          Found in src/picasso-definition/components/reference-lines/lines.js and 1 other location - About 45 mins to fix
          src/picasso-definition/components/reference-lines/labels.js on lines 113..118

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

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

              const isBinnedData = dataPages.length === 1 && !qMatrix.length && !qLeft && !qTop && !qWidth && !qHeight;
          Severity: Major
          Found in src/utils/get-num-points-in-big-data.js and 2 other locations - About 40 mins to fix
          src/data-handler/is-large-num-bubbles-from-big-data.js on lines 6..6
          src/picasso-definition/interactions/is-zoom-by-image.js on lines 9..9

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

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

                const isBinnedData = dataPages.length === 1 && !qMatrix.length && !qLeft && !qTop && !qWidth && !qHeight;
          Severity: Major
          Found in src/picasso-definition/interactions/is-zoom-by-image.js and 2 other locations - About 40 mins to fix
          src/data-handler/is-large-num-bubbles-from-big-data.js on lines 6..6
          src/utils/get-num-points-in-big-data.js on lines 6..6

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

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

              const isBinnedData = dataPages.length === 1 && !qMatrix.length && !qLeft && !qTop && !qWidth && !qHeight;
          Severity: Major
          Found in src/data-handler/is-large-num-bubbles-from-big-data.js and 2 other locations - About 40 mins to fix
          src/picasso-definition/interactions/is-zoom-by-image.js on lines 9..9
          src/utils/get-num-points-in-big-data.js on lines 6..6

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

          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 deltaMajor = node.major.p === 'x' ? deltaX / node.major.size : deltaY / node.major.size;
          Severity: Minor
          Found in src/services/trendlines-service/index.js and 1 other location - About 40 mins to fix
          src/services/trendlines-service/index.js on lines 43..43

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

          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 deltaMinor = node.minor.p === 'y' ? deltaY / node.minor.size : deltaX / node.minor.size;
          Severity: Minor
          Found in src/services/trendlines-service/index.js and 1 other location - About 40 mins to fix
          src/services/trendlines-service/index.js on lines 42..42

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

          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

          Consider simplifying this complex logical expression.
          Open

              if (dataPages.length) {
                const { qMatrix, qArea } = dataPages[0];
                const { qLeft, qTop, qWidth, qHeight } = qArea;
                const isBinnedData = dataPages.length === 1 && !qMatrix.length && !qLeft && !qTop && !qWidth && !qHeight;
                if (isBinnedData) return true;
          Severity: Major
          Found in src/picasso-definition/interactions/is-zoom-by-image.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

              if (dataPages.length) {
                const { qMatrix, qArea } = dataPages[0];
                const { qLeft, qTop, qWidth, qHeight } = qArea;
                const isBinnedData = dataPages.length === 1 && !qMatrix.length && !qLeft && !qTop && !qWidth && !qHeight;
                if (isBinnedData) {
            Severity: Major
            Found in src/utils/get-num-points-in-big-data.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                if (app && (app.session?.options || app.enigmaModel?.session?.sessionConfig || app.session?.config?.url)) {
                  config = app.session.options || app.enigmaModel?.session.sessionConfig;
              
                  // fix for usage in mashups
                  if (!config) {
              Severity: Major
              Found in src/custom-tooltip/promises/images.js - About 40 mins to fix
                Severity
                Category
                Status
                Source
                Language