lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

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

const ButtonSelector = ({
  blockId,
  components,
  events,
  loading,

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

const RadioSelector = ({
  blockId,
  components,
  events,
  loading,

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

const TagBlock = ({
  blockId,
  components: { Icon },
  events,
  methods,
Severity: Minor
Found in packages/plugins/blocks/blocks-antd/src/blocks/Tag/Tag.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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { children, description, fallback, fullPage, message, name } = this.props;
    const { hasError, error } = this.state;
    if (hasError) {
      if (fallback) {
Severity: Minor
Found in packages/utils/block-utils/src/ErrorBoundary.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 Label has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Confirmed

const Label = ({
  blockId,
  components: { Icon },
  content,
  methods,
Severity: Minor
Found in packages/plugins/blocks/blocks-antd/src/blocks/Label/Label.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

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