lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

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

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

      async function handler({ req, res }) {
        if (req.method !== 'GET') {
          throw new Error('Only GET requests are supported.');
        }
      
      
      Severity: Major
      Found in packages/servers/server-enterprise/pages/api/license.js and 1 other location - About 3 hrs to fix
      packages/servers/server-dev/pages/api/license.js on lines 13..20

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

      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

                  onChange={(event) => {
                    methods.setValue(
                      type.isPrimitive(uniqueValueOptions[event.target.value])
                        ? uniqueValueOptions[event.target.value]
                        : uniqueValueOptions[event.target.value].value
      packages/plugins/blocks/blocks-antd/src/blocks/ButtonSelector/ButtonSelector.js on lines 63..70

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

      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

      async function handler({ req, res }) {
        if (req.method !== 'GET') {
          throw new Error('Only GET requests are supported.');
        }
      
      
      Severity: Major
      Found in packages/servers/server-dev/pages/api/license.js and 1 other location - About 3 hrs to fix
      packages/servers/server-enterprise/pages/api/license.js on lines 13..20

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

      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

                  onChange={(event) => {
                    methods.setValue(
                      type.isPrimitive(uniqueValueOptions[event.target.value])
                        ? uniqueValueOptions[event.target.value]
                        : uniqueValueOptions[event.target.value].value
      packages/plugins/blocks/blocks-antd/src/blocks/RadioSelector/RadioSelector.js on lines 64..71

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

      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 context = {
            // Important to give absolute path so Next can trace build files
            rid: crypto.randomUUID(),
            buildDirectory: path.join(process.cwd(), 'build'),
            config,
      packages/servers/server-community/lib/server/serverSidePropsWrapper.js on lines 29..40

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

      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 context = {
            // Important to give absolute path so Next can trace build files
            rid: crypto.randomUUID(),
            buildDirectory: path.join(process.cwd(), 'build'),
            config,
      packages/servers/server-enterprise/lib/server/serverSidePropsWrapper.js on lines 26..37

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

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

        Function kindOf has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function kindOf(val) {
          // eslint-disable-next-line no-void
          if (val === void 0) return 'undefined';
          if (val === null) return 'null';
        
        
        Severity: Major
        Found in packages/utils/helpers/src/type.js - About 2 hrs to fix

          Function parse has a Cognitive Complexity of 19 (exceeds 5 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 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 PageSiderMenu has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Confirmed

          const PageSiderMenu = ({
            basePath,
            blockId,
            components: { Icon, Link },
            events,

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

          const DateTimeSelector = ({
            blockId,
            components: { Icon },
            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 AgGrid has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Confirmed

          const AgGrid = ({ properties, methods, loading, events }) => {
            const {
              quickFilterValue,
              columnDefs,
              defaultColDef,
          Severity: Minor
          Found in packages/plugins/blocks/blocks-aggrid/src/AgGrid.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 kindOf has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          function kindOf(val) {
            // eslint-disable-next-line no-void
            if (val === void 0) return 'undefined';
            if (val === null) return 'null';
          
          
          Severity: Minor
          Found in packages/utils/helpers/src/type.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 enforceType has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          function enforceType(typeName, value) {
            switch (typeName) {
              case 'string':
                return type.isString(value) && value !== '' ? value : null;
              case 'number':
          Severity: Minor
          Found in packages/utils/helpers/src/type.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