lowdefy/lowdefy

View on GitHub

Showing 199 of 9,537 total issues

Avoid too many return statements within this function.
Open

  if (isDate(val)) return 'date';
Severity: Major
Found in packages/utils/helpers/src/type.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Confirmed

      return 0;
    Severity: Major
    Found in packages/layout/src/deriveLayout.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
      Severity: Major
      Found in packages/utils/helpers/src/type.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          if (type === 'number') return 'number';
        Severity: Major
        Found in packages/utils/helpers/src/type.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            if (type === 'symbol') return 'symbol';
          Severity: Major
          Found in packages/utils/helpers/src/type.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return 'generator';
            Severity: Major
            Found in packages/utils/helpers/src/type.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                if (isRegexp(val)) return 'regexp';
              Severity: Major
              Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  if (isArguments(val)) return 'arguments';
                Severity: Major
                Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    if (isError(val)) return 'error';
                  Severity: Major
                  Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return isGeneratorFn(val) ? 'generatorfunction' : 'function';
                    Severity: Major
                    Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Confirmed

                        return 1;
                      Severity: Major
                      Found in packages/layout/src/deriveLayout.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          if (isArray(val)) return 'array';
                        Severity: Major
                        Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            if (isBuffer(val)) return 'buffer';
                          Severity: Major
                          Found in packages/utils/helpers/src/type.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return `{${out.join(',')}${indent}}`;
                            Severity: Major
                            Found in packages/utils/helpers/src/stableStringify.js - About 30 mins to fix

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

                              const ControlledListBlock = ({
                                blockId,
                                components: { Icon, Link },
                                events,
                                list,

                              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 applyArrayIndices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const applyArrayIndices = (arrayIndices, name) => {
                                if (!type.isArray(arrayIndices)) return name;
                                if (arrayIndices.length === 0) return name;
                                if (type.isNumber(name)) return name;
                                const copy = JSON.parse(JSON.stringify(arrayIndices));
                              Severity: Minor
                              Found in packages/utils/helpers/src/applyArrayIndices.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 getSheetFromDoc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Confirmed

                              function getSheetFromDoc({ doc, sheetId, sheetIndex }) {
                                let sheet;
                                if (sheetId) {
                                  sheet = doc.sheetsById[sheetId];
                                  if (!sheet) {

                              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 _switch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Confirmed

                              function _switch({ location, params }) {
                                if (!type.isArray(params.branches)) {
                                  throw new Error(
                                    `Operator Error: switch takes an array type as input for the branches. Received: ${JSON.stringify(
                                      params
                              Severity: Minor
                              Found in packages/plugins/operators/operators-js/src/operators/shared/switch.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 TextAreaBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Confirmed

                              const TextAreaBlock = ({
                                blockId,
                                components,
                                events,
                                loading,
                              Severity: Minor
                              Found in packages/plugins/blocks/blocks-antd/src/blocks/TextArea/TextArea.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 displayMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Confirmed

                                displayMessage({ defaultMessage, duration, hideExplicitly, message, status }) {
                                  let close = () => undefined;
                                  if ((hideExplicitly && message !== false) || (!hideExplicitly && !type.isNone(message))) {
                                    close = this.context._internal.lowdefy._internal.displayMessage({
                                      content: type.isString(message) ? message : defaultMessage,
                              Severity: Minor
                              Found in packages/engine/src/Actions.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