lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

File Menu.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  Copyright 2020-2024 Lowdefy, Inc

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
Severity: Minor
Found in packages/plugins/blocks/blocks-antd/src/blocks/Menu/Menu.js - About 2 hrs to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                  onSearch={async (value) => {
                    setFetch(true);
                    const result = await methods.triggerEvent({ name: 'onSearch', event: { value } });
                    if (!result.bounced) {
                      setFetch(false);
    packages/plugins/blocks/blocks-antd/src/blocks/Selector/Selector.js on lines 113..119

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 74.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      if (home.configured === false) {
        logger.info({ event: 'redirect_to_homepage', pageId: home.pageId });
        return {
          redirect: {
            destination: `/${home.pageId}`,
    Severity: Major
    Found in packages/servers/server-enterprise/pages/index.js and 1 other location - About 1 hr to fix
    packages/servers/server-community/pages/index.js on lines 26..34

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 74.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      if (home.configured === false) {
        logger.info({ event: 'redirect_to_homepage', pageId: home.pageId });
        return {
          redirect: {
            destination: `/${home.pageId}`,
    Severity: Major
    Found in packages/servers/server-community/pages/index.js and 1 other location - About 1 hr to fix
    packages/servers/server-enterprise/pages/index.js on lines 20..28

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 74.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                  onSearch={async (value) => {
                    setFetch(true);
                    const result = await methods.triggerEvent({ name: 'onSearch', event: { value } });
                    if (!result.bounced) {
                      setFetch(false);
    packages/plugins/blocks/blocks-antd/src/blocks/MultipleSelector/MultipleSelector.js on lines 151..157

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 74.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function link has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function link(props) {
        if (props.disabled === true) {
          return disabledLink(props);
        }
        if (
    Severity: Minor
    Found in packages/engine/src/createLink.js - About 1 hr to fix

      Function parse has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        parse({ args, input, location, operatorPrefix = '_' }) {
          if (type.isUndefined(input)) {
            return { output: input, errors: [] };
          }
          if (args && !type.isArray(args)) {
      Severity: Minor
      Found in packages/operators/src/serverParser.js - About 1 hr to fix

        Function parse has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          parse({ args, input, location, operatorPrefix = '_' }) {
            if (type.isUndefined(input)) {
              return { output: input, errors: [] };
            }
            if (args && !type.isArray(args)) {
        Severity: Minor
        Found in packages/operators/src/buildParser.js - About 1 hr to fix

          Function constructor has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            constructor(props) {
              super(props);
              this.triggerEvent = this.triggerEvent.bind(this);
              // TODO: Test events.
              this.allEvents = {
          Severity: Minor
          Found in packages/plugins/blocks/blocks-echarts/src/blocks/EChart/EChart.js - About 1 hr to fix

            Function reset has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Confirmed

              reset(initWithState) {
                const initState = serializer.copy(initWithState || this.context.state);
                this.loopBlocks((block) => {
                  block.update = true;
                  block.showValidation = false;
            Severity: Minor
            Found in packages/engine/src/Blocks.js - About 1 hr to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                const getRowId = useCallback(
                  (params) =>
                    params.data[properties.rowId] ??
                    params.data.id ??
                    params.data._id ??
              Severity: Major
              Found in packages/plugins/blocks/blocks-aggrid/src/AgGrid.js and 1 other location - About 1 hr to fix
              packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js on lines 32..39

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 69.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                const getRowId = useCallback(
                  (params) =>
                    params.data[properties.rowId] ??
                    params.data.id ??
                    params.data._id ??
              Severity: Major
              Found in packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js and 1 other location - About 1 hr to fix
              packages/plugins/blocks/blocks-aggrid/src/AgGrid.js on lines 38..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 69.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function mediaToCssObject has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const mediaToCssObject = (styles, styleObjectOnly) => {
                if (type.isString(styles)) {
                  return styles.replace(mediaRegex, setReplacer);
                }
                let styleObjects = styles;
              Severity: Minor
              Found in packages/utils/block-utils/src/mediaToCssObject.js - About 1 hr to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  if (!res.ok) {
                    // TODO: check
                    const body = await res.json();
                    console.log(res);
                    console.log(body);
                Severity: Major
                Found in packages/client/src/request.js and 1 other location - About 1 hr to fix
                packages/servers/server-dev/lib/client/utils/request.js on lines 28..34

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 68.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  if (!res.ok) {
                    // TODO: check
                    const body = await res.json();
                    console.log(res);
                    console.log(body);
                Severity: Major
                Found in packages/servers/server-dev/lib/client/utils/request.js and 1 other location - About 1 hr to fix
                packages/client/src/request.js on lines 25..31

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 68.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Confirmed

                  if (!meta[methodName] && !functions[methodName]) {
                    throw new Error(
                      `Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(
                        meta
                      ).join(', ')}.
                Severity: Major
                Found in packages/operators/src/runClass.js and 1 other location - About 1 hr to fix
                packages/operators/src/runInstance.js on lines 20..27

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 68.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  if (!meta[methodName]) {
                    throw new Error(
                      `Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(
                        meta
                      ).join(', ')}.
                Severity: Major
                Found in packages/operators/src/runInstance.js and 1 other location - About 1 hr to fix
                packages/operators/src/runClass.js on lines 34..41

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 68.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function content has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        content: () => {
                          const runAfterUpdate = useRunAfterUpdate();
                          return (
                            <TextAreaComp
                              id={`${blockId}_input`}
                Severity: Minor
                Found in packages/plugins/blocks/blocks-antd/src/blocks/TextArea/TextArea.js - About 1 hr to fix

                  Function setupLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Confirmed

                  function setupLink(lowdefy) {
                    const { router } = lowdefy._internal;
                    const { window } = lowdefy._internal.globals;
                    const backLink = () => router.back();
                    const disabledLink = () => {};
                  Severity: Minor
                  Found in packages/client/src/setupLink.js - About 1 hr to fix

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                    function getAuthOptions({ logger }) {
                      return getNextAuthConfig({
                        authJson,
                        logger,
                        plugins: { adapters, callbacks, events, providers },
                    packages/servers/server-enterprise/lib/server/auth/getAuthOptions.js on lines 20..27

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 67.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language