lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

Function parse has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

  parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
    if (type.isUndefined(input)) {
      return { output: input, errors: [] };
    }
    if (event && !type.isObject(event)) {
Severity: Major
Found in packages/operators/src/webParser.js - About 2 hrs to fix

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

      useEffect(() => {
        methods.setValue({ file: null, fileList: [] });
        methods.registerEvent({
          name: '__getS3PostPolicy',
          actions: [
    packages/plugins/plugins/plugin-aws/src/blocks/S3UploadPhoto/S3UploadPhoto.js on lines 34..46

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

    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

      useEffect(() => {
        methods.setValue({ file: null, fileList: [] });
        methods.registerEvent({
          name: '__getS3PostPolicy',
          actions: [
    packages/plugins/plugins/plugin-aws/src/blocks/S3UploadButton/S3UploadButton.js on lines 33..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 83.

    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 buildEvents has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

    function buildEvents(block, pageContext) {
      if (block.events) {
        Object.keys(block.events).map((key) => {
          if (
            (!type.isArray(block.events[key]) && !type.isObject(block.events[key])) ||
    Severity: Major
    Found in packages/build/src/build/buildPages/buildBlock/buildEvents.js - About 2 hrs to fix

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

      Object.keys(blocks).forEach((block) => {
        icons[block] = blocks[block].meta.icons ?? [];
        styles[block] = blocks[block].meta.styles ?? [];
      });
      Severity: Major
      Found in packages/plugins/blocks/blocks-markdown/src/types.js and 10 other locations - About 2 hrs to fix
      packages/plugins/blocks/blocks-aggrid/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-algolia/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-google-maps/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-qr/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-antd/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-basic/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-color-selectors/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-echarts/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-loaders/src/types.js on lines 22..25
      packages/plugins/plugins/plugin-aws/src/types.js on lines 23..26

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

      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 11 locations. Consider refactoring.
      Open

      Object.keys(blocks).forEach((block) => {
        icons[block] = blocks[block].meta.icons ?? [];
        styles[block] = blocks[block].meta.styles ?? [];
      });
      Severity: Major
      Found in packages/plugins/plugins/plugin-aws/src/types.js and 10 other locations - About 2 hrs to fix
      packages/plugins/blocks/blocks-aggrid/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-algolia/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-google-maps/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-qr/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-antd/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-basic/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-color-selectors/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-echarts/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-loaders/src/types.js on lines 22..25
      packages/plugins/blocks/blocks-markdown/src/types.js on lines 22..25

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

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

      const labelLogic = ({
        blockId,
        content,
        methods,
        properties = {},
      Severity: Minor
      Found in packages/plugins/blocks/blocks-antd/src/blocks/Label/labelLogic.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 parse has a Cognitive Complexity of 17 (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/serverParser.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 stubBlockProps has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      const stubBlockProps = ({ block, meta, logger = () => null, initialValue, schema }) => {
        const [value, setState] = useState(type.enforceType(meta.valueType, block.value || initialValue));
        const setValue = (val) => {
          setState(type.enforceType(meta.valueType, val));
        };
      Severity: Minor
      Found in packages/utils/block-dev/src/stubBlockProps.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 getter has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function getter(target, path, options) {
        if (typeTest.isNone(path) || !isValidObject(target)) {
          return typeof options.default !== 'undefined' ? options.default : undefined;
        }
      
      
      Severity: Major
      Found in packages/utils/helpers/src/get.js - About 2 hrs to fix

        Function stableStringify has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        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: Major
        Found in packages/utils/helpers/src/stableStringify.js - About 2 hrs to fix

          Function createIcon has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Confirmed

          const createIcon = (Icons) => {
            const AiOutlineLoading3Quarters = Icons['AiOutlineLoading3Quarters'];
            const AiOutlineExclamationCircle = Icons['AiOutlineExclamationCircle'];
          
            const IconBlock = ({ blockId, events, methods, onClick, properties, ...props }) => {
          Severity: Major
          Found in packages/client/src/createIcon.js - About 2 hrs to fix

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

              parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
                if (type.isUndefined(input)) {
                  return { output: input, errors: [] };
                }
                if (event && !type.isObject(event)) {
            Severity: Minor
            Found in packages/operators/src/webParser.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 makeReplacer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            const makeReplacer = (customReplacer, isoStringDates) => (key, value) => {
              let dateReplacer = (date) => ({ '~d': date.valueOf() });
              if (isoStringDates) {
                dateReplacer = (date) => ({ '~d': date.toISOString() });
              }
            Severity: Minor
            Found in packages/utils/helpers/src/serializer.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 getFromArray has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            function getFromArray({ params, array, key, operator, location }) {
              if (params === true) return array;
              if (type.isString(params)) {
                return array.find((item) => item[key] === params);
              }
            Severity: Minor
            Found in packages/operators/src/getFromArray.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 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 validateAuthConfig has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            async function validateAuthConfig({ components }) {
              if (type.isNone(components.auth)) {
                components.auth = {};
              }
              if (!type.isObject(components.auth)) {
            Severity: Minor
            Found in packages/build/src/build/buildAuth/validateAuthConfig.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
                Severity
                Category
                Status
                Source
                Language