qlik-oss/sn-action-button

View on GitHub

Showing 203 of 203 total issues

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

    it("should return specified image size", () => {
      style.background = {
        useImage: true,
        size: "fill",
        url: {
Severity: Major
Found in src/utils/__tests__/style-formatter.spec.js and 1 other location - About 4 hrs to fix
src/utils/__tests__/style-formatter.spec.js on lines 220..232

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

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

    it("should call clearAllButThis", async () => {
      const actionObject = actions.find((action) => action.value === "clearAllButThis");
      await actionObject.getActionCall({ app, qStateName, field })();
      expect(app.getField).toHaveBeenCalledWith(field, qStateName);
      expect(fieldObject.clearAllButThis).toHaveBeenCalledWith(false);
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 1 other location - About 3 hrs to fix
src/utils/__tests__/actions.spec.js on lines 275..280

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

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

    it("should call selectPossible", async () => {
      const actionObject = actions.find((action) => action.value === "selectPossible");
      await actionObject.getActionCall({ app, qStateName, field })();
      expect(app.getField).toHaveBeenCalledWith(field, qStateName);
      expect(fieldObject.selectPossible).toHaveBeenCalledWith(false);
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 1 other location - About 3 hrs to fix
src/utils/__tests__/actions.spec.js on lines 163..168

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

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

    it("should call unlockField", async () => {
      const actionObject = actions.find((action) => action.value === "unlockField");
      await actionObject.getActionCall({ app, qStateName, field })();
      expect(app.getField).toHaveBeenCalledWith(field, qStateName);
      expect(fieldObject.unlock).toHaveBeenCalled();
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 3 hrs to fix
src/utils/__tests__/actions.spec.js on lines 177..182
src/utils/__tests__/actions.spec.js on lines 295..300

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

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

    it("should call lockField", async () => {
      const actionObject = actions.find((action) => action.value === "lockField");
      await actionObject.getActionCall({ app, qStateName, field })();
      expect(app.getField).toHaveBeenCalledWith(field, qStateName);
      expect(fieldObject.lock).toHaveBeenCalled();
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 3 hrs to fix
src/utils/__tests__/actions.spec.js on lines 177..182
src/utils/__tests__/actions.spec.js on lines 315..320

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

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

  {
    value: "unlockField",
    translation: "Object.ActionButton.UnlockAField",
    group: "selection",
    getActionCall:
Severity: Major
Found in src/utils/actions.js and 1 other location - About 3 hrs to fix
src/utils/actions.js on lines 241..255

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

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

  {
    value: "lockField",
    translation: "Object.ActionButton.LockField",
    group: "selection",
    getActionCall:
Severity: Major
Found in src/utils/actions.js and 1 other location - About 3 hrs to fix
src/utils/actions.js on lines 268..282

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

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

    it("should call clearField", async () => {
      const actionObject = actions.find((action) => action.value === "clearField");
      await actionObject.getActionCall({ app, qStateName, field })();
      expect(app.getField).toHaveBeenCalledWith(field, qStateName);
      expect(fieldObject.clear).toHaveBeenCalled();
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 3 hrs to fix
src/utils/__tests__/actions.spec.js on lines 295..300
src/utils/__tests__/actions.spec.js on lines 315..320

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

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

      it("should call storeTempSelectionState and open url in same window", async () => {
        const navigationObject = navigationActions.find((navigation) => navigation.value === "openChainedApp");
        await navigationObject.navigationCall({ app, sameWindow: true, appId, sheet });
        expect(global.open).toHaveBeenCalledWith(
          `../sense/app/${appId}/sheet/${sheet}/tempselectionstate/tempBookmarkId`,
Severity: Major
Found in src/utils/__tests__/navigation-actions.spec.js and 1 other location - About 3 hrs to fix
src/utils/__tests__/navigation-actions.spec.js on lines 167..175

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

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

      it("should call storeTempSelectionState and open url", async () => {
        const navigationObject = navigationActions.find((navigation) => navigation.value === "openChainedApp");
        await navigationObject.navigationCall({ app, sameWindow: false, appId, sheet });
        expect(global.open).toHaveBeenCalledWith(
          `../sense/app/${appId}/sheet/${sheet}/tempselectionstate/tempBookmarkId`,
Severity: Major
Found in src/utils/__tests__/navigation-actions.spec.js and 1 other location - About 3 hrs to fix
src/utils/__tests__/navigation-actions.spec.js on lines 176..184

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

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

    it("should show borderColor when no expression is used", () => {
      data.style.border.useBorder = true;
      const borderColor = backgroundBorderItem.items.colorPicker.show(data);
      const borderColorExpression = backgroundBorderItem.items.colorExpression.show(data);
      expect(borderColor).toBe(true);
Severity: Major
Found in src/__tests__/ext.spec.js and 1 other location - About 3 hrs to fix
src/__tests__/ext.spec.js on lines 471..477

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

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

    it("should return true for expression and false for picker when background.useColorExpression is true", () => {
      data.style.background.useColorExpression = true;
      const resultExpression = backgroundColor.items.colorExpression.show(data);
      const resultPicker = backgroundColor.items.colorPicker.show(data);
      expect(resultExpression).toBe(true);
Severity: Major
Found in src/__tests__/ext.spec.js and 1 other location - About 3 hrs to fix
src/__tests__/ext.spec.js on lines 529..535

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

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 run has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function run() {
  function connect() {
    const schemaPromise = fetch("https://unpkg.com/enigma.js/schemas/3.2.json").then((response) => response.json());

    const openDoc = (appId) =>
Severity: Major
Found in example/index.js - About 3 hrs to fix

    File navigation-actions.spec.js has 314 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import defaultValues from "../../__tests__/default-button-props";
    import navigationActions, {
      checkShowNavigation,
      getNavigationsList,
      getOrderedSheets,
    Severity: Minor
    Found in src/utils/__tests__/navigation-actions.spec.js - About 3 hrs to fix

      File styling-panel-definition.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { fontResolver as createFontResolver } from "qlik-chart-modules";
      import styleDefaults from "./style-defaults";
      import propertyResolver from "./utils/property-resolver";
      import { colorOptions, sizeBehaviorOptions, toggleOptions } from "./utils/style-utils";
      
      
      Severity: Minor
      Found in src/styling-panel-definition.js - About 3 hrs to fix

        Function parseOutput has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        export const parseOutput = (data, translator) => {
          const defaultMessage = { message: getDefaultMessage(translator) };
          if (typeof data !== "undefined") {
            if (typeof data === "object") {
              if (Array.isArray(data)) {
        Severity: Minor
        Found in src/utils/automation-helper.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            it("should NOT call toggleSelect when no field", async () => {
              const actionObject = actions.find((action) => action.value === "toggleSelect");
              field = null;
              await actionObject.getActionCall({ app, qStateName, field, value })();
              expect(fieldObject.toggleSelect).toHaveBeenCalledTimes(0);
        Severity: Major
        Found in src/utils/__tests__/actions.spec.js and 1 other location - About 3 hrs to fix
        src/utils/__tests__/actions.spec.js on lines 170..175

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

        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

            it("should NOT call clearAllButThis when no field", async () => {
              const actionObject = actions.find((action) => action.value === "clearAllButThis");
              field = null;
              await actionObject.getActionCall({ app, qStateName, field, softLock })();
              expect(fieldObject.clearAllButThis).toHaveBeenCalledTimes(0);
        Severity: Major
        Found in src/utils/__tests__/actions.spec.js and 1 other location - About 3 hrs to fix
        src/utils/__tests__/actions.spec.js on lines 212..217

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

        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

            it("should return specified font color", () => {
              style.font.color = someColor;
              const formattedStyle = styleFormatter.getStyles({ style, disabled, theme, element, app });
              expect(formattedStyle.includes(`color: ${someColor}`)).toBe(true);
            });
        Severity: Major
        Found in src/utils/__tests__/style-formatter.spec.js and 1 other location - About 3 hrs to fix
        src/utils/__tests__/style-formatter.spec.js on lines 92..96

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

        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

            it("should return specified background color", () => {
              style.background.color = someColor;
              const formattedStyle = styleFormatter.getStyles({ style, disabled, theme, element, app });
              expect(formattedStyle.includes(`background-color: ${someColor}`)).toBe(true);
            });
        Severity: Major
        Found in src/utils/__tests__/style-formatter.spec.js and 1 other location - About 3 hrs to fix
        src/utils/__tests__/style-formatter.spec.js on lines 63..67

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

        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

        Severity
        Category
        Status
        Source
        Language