lowdefy/lowdefy

View on GitHub

Showing 198 of 9,127 total issues

Function split has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function split(path, options) {
  const id = createKey(path, options);
  if (set.memo[id]) return set.memo[id];

  const char = options && options.separator ? options.separator : '.';
Severity: Minor
Found in packages/utils/helpers/src/set.js - About 35 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 getLowdefyYaml has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

async function getLowdefyYaml({ configDirectory, requiresLowdefyYaml }) {
  let lowdefyYaml = await readFile(path.join(configDirectory, 'lowdefy.yaml'));
  if (!lowdefyYaml) {
    lowdefyYaml = await readFile(path.join(configDirectory, 'lowdefy.yml'));
  }
Severity: Minor
Found in packages/cli/src/utils/getLowdefyYaml.js - About 35 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 layoutParamsToArea has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

const layoutParamsToArea = ({ areaKey, area = {}, layout = {} }) => {
  if (areaKey !== 'content') {
    return area;
  }
  area.align = type.isNone(area.align) ? layout.contentAlign : area.align;
Severity: Minor
Found in packages/layout/src/layoutParamsToArea.js - About 35 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 formatArrayKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

function formatArrayKey({ index, object }) {
  if (type.isObject(object) && (!type.isNone(object.id) || !type.isNone(object.type))) {
    const objectId = type.isNone(object.id) ? '_ERROR_MISSING_ID_' : object.id;
    const objectType = type.isNone(object.type) ? '_ERROR_MISSING_TYPE_' : object.type;
    return `[${index}:${objectId}:${objectType}]`;
Severity: Minor
Found in packages/build/src/utils/formatErrorMessage.js - About 35 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

Avoid too many return statements within this function.
Open

    return new Promise((resolve) => {
      const timeout = setTimeout(async () => {
        eventDescription.bouncer = null;
        const res = await actionHandle();
        resolve(res);
Severity: Major
Found in packages/engine/src/Events.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

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

      Avoid too many return statements within this function.
      Open

              return null;
      Severity: Major
      Found in packages/operators/src/buildParser.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return noLink(props);
        Severity: Major
        Found in packages/engine/src/createLink.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return res;
          Severity: Major
          Found in packages/operators/src/serverParser.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Confirmed

                if (type.isString(params.value)) return array.find((item) => item[key] === params.value);
            Severity: Major
            Found in packages/operators/src/getFromArray.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    if (type.isUndefined(this.operators[op])) return value;
              Severity: Major
              Found in packages/operators/src/buildParser.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return JSON.stringify(
                    json,
                    makeReplacer(options.replacer, options.isoStringDates),
                    options.space
                  );
                Severity: Major
                Found in packages/utils/helpers/src/serializer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Confirmed

                        return newOriginLink({
                          ...props,
                          url: `${protocol}${props.url}`,
                          query,
                        });
                  Severity: Major
                  Found in packages/engine/src/createLink.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Confirmed

                        if (type.isNumber(params.index)) return array[params.index];
                    Severity: Major
                    Found in packages/operators/src/getFromArray.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return null;
                      Severity: Major
                      Found in packages/operators/src/serverParser.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return res;
                        Severity: Major
                        Found in packages/operators/src/buildParser.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            return options.default;
                          Severity: Major
                          Found in packages/utils/helpers/src/get.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return res;
                            Severity: Major
                            Found in packages/operators/src/webParser.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return options.default;
                              Severity: Major
                              Found in packages/utils/helpers/src/get.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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language