qlik-oss/sn-action-button

View on GitHub
src/__tests__/ext.spec.js

Summary

Maintainability
F
4 days
Test Coverage

File ext.spec.js has 506 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import ext from "../ext";
import objectProperties from "../object-properties";

describe("ext", () => {
  const translator = {
Severity: Major
Found in src/__tests__/ext.spec.js - About 1 day to fix

    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

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

        it("Should return an array with a bookmark", async () => {
          options = await actionItems.bookmark.options(null, handler);
          expect(options).toHaveLength(1);
          expect(options[0]).toBeInstanceOf(Object);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 1 other location - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 218..222

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

    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 an array with a field", async () => {
          options = await actionItems.field.options(null, handler);
          expect(options).toHaveLength(1);
          expect(options[0]).toBeInstanceOf(Object);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 1 other location - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 212..216

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

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

        it("should return true when sameWindow needs to show", () => {
          const result = navigationItems.sameWindow.show({
            navigation: { action: "openWebsite" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 424..429
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when story needs to show", () => {
          const result = navigationItems.story.show({
            navigation: { action: "goToStory" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 424..429
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when sheetId needs to show", () => {
          const result = navigationItems.sheetId.show({
            navigation: { action: "goToSheetById" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 424..429
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when odagLink needs to show", () => {
          const result = navigationItems.odagLink.show({
            navigation: { action: "odagLink" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 424..429

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

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

        it("should return true when sheet needs to show", () => {
          const result = navigationItems.sheet.show({
            navigation: { action: "goToSheet" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 424..429
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when appId needs to show", () => {
          const result = navigationItems.appId.show({
            navigation: { action: "openChainedApp" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 410..415
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when websiteUrl needs to show", () => {
          const result = navigationItems.websiteUrl.show({
            navigation: { action: "openWebsite" },
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 1 hr to fix
    src/__tests__/ext.spec.js on lines 389..394
    src/__tests__/ext.spec.js on lines 396..401
    src/__tests__/ext.spec.js on lines 403..408
    src/__tests__/ext.spec.js on lines 417..422
    src/__tests__/ext.spec.js on lines 424..429
    src/__tests__/ext.spec.js on lines 431..436

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

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

        it("should return true when value needs to show", () => {
          const result = actionItems.value.show({ actionType: "selectValues" });
          expect(result).toBe(true);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 366..371

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

        it("should return true when automation props needs to show", () => {
          const result = actionItems.automationProps.show({
            actionType: "executeAutomation",
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 361..364

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

        it("should return true when showSystemVariables needs to show", () => {
          const result = actionItems.showSystemVariables.show({
            actionType: "setVariable",
          });
          expect(result).toBe(true);
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 361..364
    src/__tests__/ext.spec.js on lines 366..371

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

        it("should return true when field needs to show clearAllButThis", () => {
          const result = actionItems.field.show({ actionType: "clearAllButThis" });
          expect(result).toBe(true);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 361..364
    src/__tests__/ext.spec.js on lines 366..371

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

        it("should return true when field needs to show setVariable", () => {
          const result = actionItems.variable.show({ actionType: "setVariable" });
          expect(result).toBe(true);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 361..364
    src/__tests__/ext.spec.js on lines 366..371

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

        it("should return true when softLock needs to show", () => {
          const result = actionItems.softLock.show({ actionType: "selectAll" });
          expect(result).toBe(true);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 334..337
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 361..364
    src/__tests__/ext.spec.js on lines 366..371

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

        it("should return true when bookmark needs to show", () => {
          const result = actionItems.bookmark.show({ actionType: "applyBookmark" });
          expect(result).toBe(true);
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 6 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 339..342
    src/__tests__/ext.spec.js on lines 344..347
    src/__tests__/ext.spec.js on lines 349..354
    src/__tests__/ext.spec.js on lines 356..359
    src/__tests__/ext.spec.js on lines 361..364
    src/__tests__/ext.spec.js on lines 366..371

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

        it("Should return invalid action label when action is not found in actions list", () => {
          data = { actionType: "invalidAction" };
          const itemTitle = itemTitleRef(data, 0);
          expect(itemTitle).toEqual("Object.ActionButton.InvalidAction");
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 2 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 50..54
    src/__tests__/ext.spec.js on lines 56..60

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

        it("Should return action label from dropdown", () => {
          data = { actionType: "applyBookmark" };
          const itemTitle = itemTitleRef(data, 0);
          expect(itemTitle).toEqual("Object.ActionButton.ApplyBookmark");
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 2 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 56..60
    src/__tests__/ext.spec.js on lines 67..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 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 3 locations. Consider refactoring.
    Open

        it("Should return action label from text field", () => {
          data = { actionLabel: "actionLabel" };
          const itemTitle = itemTitleRef(data, 0);
          expect(itemTitle).toEqual("actionLabel");
        });
    Severity: Major
    Found in src/__tests__/ext.spec.js and 2 other locations - About 55 mins to fix
    src/__tests__/ext.spec.js on lines 50..54
    src/__tests__/ext.spec.js on lines 67..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 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 2 locations. Consider refactoring.
    Open

        it("should return false for imageSize when no image option is set", () => {
          const result = backgroundImage.items.imageSize.show(data);
          expect(result).toBe(false);
        });
    Severity: Minor
    Found in src/__tests__/ext.spec.js and 1 other location - About 50 mins to fix
    src/__tests__/ext.spec.js on lines 497..500

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

    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 false for backgroundPosition when no background image is used", () => {
          const result = backgroundImage.items.position.show(data);
          expect(result).toBe(false);
        });
    Severity: Minor
    Found in src/__tests__/ext.spec.js and 1 other location - About 50 mins to fix
    src/__tests__/ext.spec.js on lines 479..482

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

    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 an array with all stories", async () => {
          options = await navigationItems.story.options(null, handler);
          expect(options).toHaveLength(2);
        });
    Severity: Minor
    Found in src/__tests__/ext.spec.js and 1 other location - About 45 mins to fix
    src/__tests__/ext.spec.js on lines 275..278

    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

        it("Should return an array with all sheets", async () => {
          options = await navigationItems.sheet.options(null, handler);
          expect(options).toHaveLength(2);
        });
    Severity: Minor
    Found in src/__tests__/ext.spec.js and 1 other location - About 45 mins to fix
    src/__tests__/ext.spec.js on lines 300..303

    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

    There are no issues that match your filters.

    Category
    Status