lowdefy/lowdefy

View on GitHub

Showing 198 of 9,129 total issues

Function refReviver has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Confirmed

function refReviver(key, value) {
  if (type.isObject(value)) {
    if (!type.isUndefined(value._ref)) {
      return this.parsedFiles[value._ref.id];
    }
Severity: Minor
Found in packages/build/src/build/buildRefs/populateRefs.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 callActions has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

  async callActions({ actions, arrayIndices, block, catchActions, event, eventName, progress }) {
    const startTimestamp = new Date();
    const responses = {};
    try {
      await this.callActionLoop({ actions, arrayIndices, block, event, responses, progress });
Severity: Major
Found in packages/engine/src/Actions.js - About 2 hrs to fix

    Function makeReplacer has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const makeReplacer = (customReplacer, isoStringDates) => (key, value) => {
      let dateReplacer = (date) => ({ '~d': date.valueOf() });
      if (isoStringDates) {
        dateReplacer = (date) => ({ '~d': date.toISOString() });
      }
    Severity: Major
    Found in packages/utils/helpers/src/serializer.js - About 2 hrs to fix

      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

        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

                  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

                    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

                        Function getCallbackUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Confirmed

                        function getCallbackUrl({ lowdefy, callbackUrl = {} }) {
                          const { home, pageId, urlQuery, url } = callbackUrl;
                        
                          if ([!home, !pageId, !url].filter((v) => !v).length > 1) {
                            throw Error(
                        Severity: Minor
                        Found in packages/client/src/auth/createAuthMethods.js - About 1 hr 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 ParagraphInput has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const ParagraphInput = ({
                          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 set has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function set(target, path, value, options) {
                          if (!type.isObject(target)) {
                            return target;
                          }
                        
                        
                        Severity: Minor
                        Found in packages/utils/helpers/src/set.js - About 1 hr 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 fetchNpmTarball has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Confirmed

                        async function fetchNpmTarball({ packageName, version, directory }) {
                          const registryUrl = `https://registry.npmjs.org/${packageName}`;
                          let packageInfo;
                          try {
                            packageInfo = await axios.get(registryUrl);
                        Severity: Minor
                        Found in packages/cli/src/utils/fetchNpmTarball.js - About 1 hr 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 reviver has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Confirmed

                            const reviver = (_, value) => {
                              if (!type.isObject(value)) return value;
                              // TODO: pass ~k in errors.
                              // const _k = value['~k'];
                              delete value['~k'];
                        Severity: Minor
                        Found in packages/operators/src/webParser.js - About 1 hr to fix

                          Function makeReviver has 37 lines of code (exceeds 25 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 1 hr to fix

                            Function getBlockMatcher has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Confirmed

                            const getBlockMatcher = (params) => {
                              let testParams = params;
                              if (type.isNone(testParams)) return () => true;
                              if (type.isString(testParams)) {
                                testParams = { blockIds: [testParams] };
                            Severity: Minor
                            Found in packages/engine/src/getBlockMatcher.js - About 1 hr to fix

                              Function _operator has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Confirmed

                              function _operator(options) {
                                const { operators, params, location } = options;
                                if (!type.isString(params.name)) {
                                  throw new Error(
                                    `Operator Error: _operator.name must be a valid operator name as string. Received: ${JSON.stringify(
                                Severity
                                Category
                                Status
                                Source
                                Language