lowdefy/lowdefy

View on GitHub

Showing 199 of 9,537 total issues

Function countOperators has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

function countOperators(obj, { counter }) {
  function getOperatorsReviver(_, value) {
    if (type.isObject(value) && Object.keys(value).length === 1) {
      const key = Object.keys(value)[0];
      const [op] = key.split('.');
Severity: Minor
Found in packages/build/src/utils/countOperators.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 deriveLayout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

const deriveLayout = ({
  flex,
  offset,
  order,
  pull,
Severity: Minor
Found in packages/layout/src/deriveLayout.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 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 createSignInCallback has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

function createSignInCallback({ authConfig, plugins }) {
  const signInCallbackPlugins = createCallbackPlugins({
    authConfig,
    plugins,
    type: 'signIn',
Severity: Minor
Found in packages/api/src/routes/auth/callbacks/createSignInCallback.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 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 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.
      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 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.
          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.
              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

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

                            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 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 res;
                          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
                                Severity
                                Category
                                Status
                                Source
                                Language