lowdefy/lowdefy

View on GitHub

Showing 199 of 9,537 total issues

File Blocks.js has 555 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

/* eslint-disable no-param-reassign */

/*
  Copyright 2020-2024 Lowdefy, Inc

Severity: Major
Found in packages/engine/src/Blocks.js - About 1 day to fix

    Function getter has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
    Confirmed

    function getter(target, path, options) {
      if (typeTest.isNone(path) || !isValidObject(target)) {
        return typeof options.default !== 'undefined' ? options.default : undefined;
      }
    
    
    Severity: Minor
    Found in packages/utils/helpers/src/get.js - About 6 hrs 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 init has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

      init(initState) {
        this.loopBlocks((block) => {
          block.idPattern = block.id;
          block.blockIdPattern = block.blockId;
          block.id = applyArrayIndices(this.arrayIndices, block.idPattern);
    Severity: Major
    Found in packages/engine/src/Blocks.js - About 5 hrs to fix

      Function recEval has 123 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

        recEval(visibleParent) {
          let repeat = false;
          this.loopBlocks((block) => {
            if (block.meta.category === 'input') {
              const stateValue = get(this.context.state, block.blockId);
      Severity: Major
      Found in packages/engine/src/Blocks.js - About 4 hrs to fix

        Function stableStringify has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Confirmed

        function stableStringify(obj, opts) {
          if (!opts) opts = {};
          if (typeof opts === 'function') opts = { cmp: opts };
          let space = opts.space || '';
          if (typeof space === 'number') space = Array(space + 1).join(' ');
        Severity: Minor
        Found in packages/utils/helpers/src/stableStringify.js - About 4 hrs 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 createLinkComponent has 112 lines of code (exceeds 25 allowed). Consider refactoring.
        Confirmed

        const createLinkComponent = (lowdefy, Link) => {
          const { window } = lowdefy._internal.globals;
          const backLink = ({ ariaLabel, children, className, id, onClick = () => {}, rel }) => (
            <a
              id={id}
        Severity: Major
        Found in packages/client/src/createLinkComponent.js - About 4 hrs to fix

          Function RatingSlider has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          const RatingSlider = ({
            blockId,
            components: { Icon, Link },
            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

          File PageSiderMenu.js has 349 lines of code (exceeds 250 allowed). Consider refactoring.
          Confirmed

          /*
            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.

            Function runClass has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            const runClass = ({ location, meta, methodName, operator, params, functions, defaultFunction }) => {
              if (!methodName) {
                if (meta[params]) {
                  methodName = params;
                } else if (defaultFunction) {
            Severity: Minor
            Found in packages/operators/src/runClass.js - About 3 hrs 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 useFileList has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            const useFileList = ({ properties, methods, value = {} }) => {
              const checkedValue = (value) => {
                let file = type.isObject(value?.file) ? value.file : null;
                if (!file && type.isObject(value?.fileList?.[0])) {
                  file = value.fileList[0];
            Severity: Minor
            Found in packages/plugins/plugins/plugin-aws/src/blocks/utils/useFileList.js - About 3 hrs 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 content has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    content: () => {
                      const runAfterUpdate = useRunAfterUpdate();
                      return (
                        <Input
                          id={`${blockId}_input`}
            Severity: Major
            Found in packages/plugins/blocks/blocks-antd/src/blocks/TextInput/TextInput.js - About 3 hrs to fix

              Function createLink has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Confirmed

              function createLink({ backLink, disabledLink, lowdefy, newOriginLink, noLink, sameOriginLink }) {
                function link(props) {
                  if (props.disabled === true) {
                    return disabledLink(props);
                  }
              Severity: Minor
              Found in packages/engine/src/createLink.js - About 3 hrs 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 getStaticProps has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export async function getStaticProps() {
                const rootConfig = {
                  home: {
                    configured: false,
                    pageId: '',
              Severity: Major
              Found in packages/servers/server-enterprise/pages/lowdefy/license-invalid.js - About 3 hrs to fix

                Function content has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Confirmed

                        content: () => {
                          return (
                            <Input
                              id={`${blockId}_input`}
                              addonBefore={

                  Function makeReviver has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const makeReviver = (customReviver) => (key, value) => {
                    let newValue = value;
                    if (type.isObject(newValue)) {
                      if (newValue['~r']) {
                        Object.defineProperty(newValue, '~r', {
                  Severity: Minor
                  Found in packages/utils/helpers/src/serializer.js - About 3 hrs 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 createLinkComponent has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Confirmed

                  const createLinkComponent = (lowdefy, Link) => {
                    const { window } = lowdefy._internal.globals;
                    const backLink = ({ ariaLabel, children, className, id, onClick = () => {}, rel }) => (
                      <a
                        id={id}
                  Severity: Minor
                  Found in packages/client/src/createLinkComponent.js - About 3 hrs 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 callAction has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Confirmed

                    async callAction({ action, arrayIndices, block, event, index, progress, responses }) {
                      if (!this.actions[action.type]) {
                        throw {
                          error: new Error(`Invalid action type "${action.type}" at "${block.blockId}".`),
                          type: action.type,
                  Severity: Major
                  Found in packages/engine/src/Actions.js - About 3 hrs to fix

                    Function triggerEvent has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Confirmed

                      triggerEvent({ name, event, progress }) {
                        this.context._internal.lowdefy.eventCallback?.({ name, blockId: this.block.blockId });
                        const eventDescription = this.events[name];
                        const result = {
                          blockId: this.block.blockId,
                    Severity: Major
                    Found in packages/engine/src/Events.js - About 2 hrs to fix

                      Function AgGridInput has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Confirmed

                      const AgGridInput = ({ properties, methods, loading, events, value }) => {
                        const { quickFilterValue, columnDefs, defaultColDef, ...someProperties } = properties;
                        const [rowData, setRowData] = useState(value ?? []);
                      
                        const gridRef = useRef();
                      Severity: Minor
                      Found in packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js - About 2 hrs 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 runInstance has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Confirmed

                      const runInstance = ({ location, meta, methodName, operator, params, instanceType }) => {
                        if (!meta[methodName]) {
                          throw new Error(
                            `Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(
                              meta
                      Severity: Minor
                      Found in packages/operators/src/runInstance.js - About 2 hrs 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