qlik-oss/sn-action-button

View on GitHub

Showing 54 of 203 total issues

Avoid too many return statements within this function.
Open

      return resolve({
        message: getDefaultMessage(translator),
        ok: true,
      });
Severity: Major
Found in src/utils/automation-helper.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return { message: data };
    Severity: Major
    Found in src/utils/automation-helper.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return resolve({
              message: getDefaultMessage(translator),
              ok: true,
            });
      Severity: Major
      Found in src/utils/automation-helper.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return defaultMessage;
        Severity: Major
        Found in src/utils/automation-helper.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return resolve({ ...parseOutput(automationRun.title, translator), ok: true });
          Severity: Major
          Found in src/utils/automation-helper.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return defaultMessage;
            Severity: Major
            Found in src/utils/automation-helper.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
              Severity: Major
              Found in src/utils/automation-helper.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return resolve({
                        message: getTranslation(translator, "Object.ActionButton.Automation.DefaultAutomationMsg", "Unknown error"),
                        ok: false,
                      });
                Severity: Major
                Found in src/utils/automation-helper.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
                  Severity: Major
                  Found in src/utils/automation-helper.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return resolve({ ...parseOutput(automationRun.title, translator), ok: false });
                    Severity: Major
                    Found in src/utils/automation-helper.js - About 30 mins to fix

                      Function runActions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const runActions = async ({ actionCallList, model, layout, app }) => {
                        const properties = await model.getEffectiveProperties();
                        for (let i = 0; i < actionCallList.length; i++) {
                          if (layout.runtimeExpressionEvaluation) {
                            const overrideValue =
                      Severity: Minor
                      Found in src/components/action-button.js - About 25 mins 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

                      Function adjustFontSizeBehavior has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const adjustFontSizeBehavior = (button, font, text, textSpan, hasIcon) => {
                        if (font.sizeBehavior === "fixed") {
                          // The font size is independent of the box size and the length of the text
                          text.style.fontSize = `${font.sizeFixed || DEFAULTS.FONT_SIZE_FIXED}px`;
                          setFontSizeBehaviorStyle(button, text, textSpan, hasIcon);
                      Severity: Minor
                      Found in src/utils/style-utils.js - About 25 mins 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

                      Function getBackgroundStyle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const getBackgroundStyle = (background, theme, app, formatProperty) => {
                        let styles = formatProperty("background-color", getBackgroundColor(background, theme));
                        if ((background.useImage || background.mode === "media") && background.url.qStaticContentUrl) {
                          let bgUrl = background.url.qStaticContentUrl.qUrl;
                          if (bgUrl) {
                      Severity: Minor
                      Found in src/utils/style-utils.js - About 25 mins 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

                      Function pollAutomationAndGetMsg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const pollAutomationAndGetMsg = async (automationId, triggered, response, translator) => {
                        let message;
                        switch (response.status) {
                          case 200:
                          case 201: {
                      Severity: Minor
                      Found in src/utils/automation-helper.js - About 25 mins 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

                      Severity
                      Category
                      Status
                      Source
                      Language