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

  describe("getNavigationsList", () => {
    it("should return all but not FF disabled navigations", () => {
      const shouldHide = {
        isUnsupportedFeature: jest.fn().mockReturnValue(false),
        isFeatureBlacklisted: jest.fn().mockReturnValue(false),
Severity: Major
Found in src/utils/__tests__/navigation-actions.spec.js and 1 other location - About 2 days to fix
src/utils/__tests__/actions.spec.js on lines 570..607

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

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

  describe("getActionsList", () => {
    it("should return all but not FF disabled actions", () => {
      const shouldHide = {
        isUnsupportedFeature: jest.fn().mockReturnValue(false),
        isFeatureBlacklisted: jest.fn().mockReturnValue(false),
Severity: Major
Found in src/utils/__tests__/actions.spec.js and 1 other location - About 2 days to fix
src/utils/__tests__/navigation-actions.spec.js on lines 286..323

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File lui-icons.js has 792 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export default [
  {
    value: "image",
    icon: "image",
    label: "Image",
Severity: Major
Found in src/utils/lui-icons.js - About 1 day to fix

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

        it("should convert clearOther", () => {
          action.actionType = "clearOther";
          convertAction(action, newProperties);
          expect(newProperties.actions).toHaveLength(1);
          expect(newProperties.actions[0].actionType).toEqual("clearAllButThis");
    Severity: Major
    Found in src/utils/__tests__/conversion.spec.js and 1 other location - About 1 day to fix
    src/utils/__tests__/conversion.spec.js on lines 81..92

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

    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 convert selectField", () => {
          action.actionType = "selectField";
          convertAction(action, newProperties);
          expect(newProperties.actions).toHaveLength(1);
          expect(newProperties.actions[0].actionType).toEqual("selectMatchingValues");
    Severity: Major
    Found in src/utils/__tests__/conversion.spec.js and 1 other location - About 1 day to fix
    src/utils/__tests__/conversion.spec.js on lines 55..66

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    import actions, { checkShowAction, getActionsList, getValueList } from "../actions";
    
    describe("actions", () => {
      const qStateName = "someState";
      let app;
    Severity: Major
    Found in src/utils/__tests__/actions.spec.js - About 1 day to fix

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

      import { encodeForHTML } from "./html-encoder";
      import { encodeUrl, getCurrentProtocol, removeProtocolHttp } from "./url-encoder";
      import { inIframe } from "./url-utils";
      
      const TRANSITION_TIME = 400;
      Severity: Major
      Found in src/utils/automation-helper.js - About 1 day to fix

        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

          File style-formatter.spec.js has 483 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable prefer-destructuring */
          import defaultValues from "../../__tests__/default-button-props";
          import { getStyleEditorDefinition } from "../../styling-panel-definition";
          import styleFormatter from "../style-formatter";
          
          
          Severity: Minor
          Found in src/utils/__tests__/style-formatter.spec.js - About 7 hrs to fix

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

            import { getStylingPanelDefinition } from "./styling-panel-definition";
            import actions, { checkShowAction, getActionsList } from "./utils/actions";
            import getAutomationProps from "./utils/automation-props";
            import importProperties from "./utils/conversion";
            import luiIcons from "./utils/lui-icons";
            Severity: Minor
            Found in src/ext.js - About 6 hrs to fix

              File actions.js has 381 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import {
                getAutomationData,
                getAutomationUrl,
                getPostOptions,
                getTemporaryBookmark,
              Severity: Minor
              Found in src/utils/actions.js - About 5 hrs to fix

                Function getInputBlocks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getInputBlocks = (bookmark) => {
                  const inputBlocks = {
                    blocks: [
                      {
                        id: "EB6A372B-3312-4E90-8E8F-88F2A889B4CF",
                Severity: Major
                Found in src/utils/automation-helper.js - About 4 hrs to fix

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

                    {
                      value: "selectExcluded",
                      translation: "Object.ActionButton.SelectExcluded",
                      group: "selection",
                      getActionCall:
                  Severity: Major
                  Found in src/utils/actions.js and 1 other location - About 4 hrs to fix
                  src/utils/actions.js on lines 154..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 117.

                  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: "selectAlternative",
                      translation: "Object.ActionButton.SelectAlternatives",
                      group: "selection",
                      getActionCall:
                  Severity: Major
                  Found in src/utils/actions.js and 1 other location - About 4 hrs to fix
                  src/utils/actions.js on lines 182..196

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

                  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 selectAlternative", async () => {
                        const actionObject = actions.find((action) => action.value === "selectAlternative");
                        await actionObject.getActionCall({ app, qStateName, field, softLock })();
                        expect(app.getField).toHaveBeenCalledWith(field, qStateName);
                        expect(fieldObject.selectAlternative).toHaveBeenCalledWith(softLock);
                  Severity: Major
                  Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 4 hrs to fix
                  src/utils/__tests__/actions.spec.js on lines 191..196
                  src/utils/__tests__/actions.spec.js on lines 261..266

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

                  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 selectExcluded", async () => {
                        const actionObject = actions.find((action) => action.value === "selectExcluded");
                        await actionObject.getActionCall({ app, qStateName, field, softLock })();
                        expect(app.getField).toHaveBeenCalledWith(field, qStateName);
                        expect(fieldObject.selectExcluded).toHaveBeenCalledWith(softLock);
                  Severity: Major
                  Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 4 hrs to fix
                  src/utils/__tests__/actions.spec.js on lines 191..196
                  src/utils/__tests__/actions.spec.js on lines 247..252

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

                  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 from expression", () => {
                        style.background.colorExpression = someColorExpression;
                        style.background.useColorExpression = true;
                        const formattedStyle = styleFormatter.getStyles({ style, disabled, theme, element, app });
                        expect(formattedStyle.includes(`background-color: ${someColorExpression}`)).toBe(true);
                  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 69..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 116.

                  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 from expression", () => {
                        style.font.colorExpression = someColorExpression;
                        style.font.useColorExpression = true;
                        const formattedStyle = styleFormatter.getStyles({ style, disabled, theme, element, app });
                        expect(formattedStyle.includes(`color: ${someColorExpression}`)).toBe(true);
                  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 98..103

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 116.

                  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 selectAll", async () => {
                        const actionObject = actions.find((action) => action.value === "selectAll");
                        await actionObject.getActionCall({ app, qStateName, field, softLock })();
                        expect(app.getField).toHaveBeenCalledWith(field, qStateName);
                        expect(fieldObject.selectAll).toHaveBeenCalledWith(softLock);
                  Severity: Major
                  Found in src/utils/__tests__/actions.spec.js and 2 other locations - About 4 hrs to fix
                  src/utils/__tests__/actions.spec.js on lines 247..252
                  src/utils/__tests__/actions.spec.js on lines 261..266

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

                  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 image position", () => {
                        style.background = {
                          useImage: true,
                          position: "topLeft",
                          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 206..218

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language