lowdefy/lowdefy

View on GitHub

Showing 9,050 of 9,129 total issues

Function createIcon has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Confirmed

const createIcon = (Icons) => {
  const AiOutlineLoading3Quarters = Icons['AiOutlineLoading3Quarters'];
  const AiOutlineExclamationCircle = Icons['AiOutlineExclamationCircle'];

  const IconBlock = ({ blockId, events, methods, onClick, properties, ...props }) => {
Severity: Minor
Found in packages/client/src/createIcon.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 TitleInput has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

const TitleInput = ({
  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 stringify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  return (function stringify(parent, key, node, level) {
    const indent = space ? `\n${new Array(level + 1).join(space)}` : '';
    const colonSeparator = space ? ': ' : ':';

    if (node?.toJSON && typeof node.toJSON === 'function') {
Severity: Minor
Found in packages/utils/helpers/src/stableStringify.js - About 1 hr to fix

    Function callRequest has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

      async callRequest({ actions, arrayIndices, blockId, event, requestId }) {
        const requestConfig = this.requestConfig[requestId];
        if (!this.context.requests[requestId]) {
          this.context.requests[requestId] = [];
        }
    Severity: Minor
    Found in packages/engine/src/Requests.js - About 1 hr to fix

      Function before has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const before = () => {
          triggerEvent.mockReset();
          moveItemDown.mockReset();
          moveItemUp.mockReset();
          pushItem.mockReset();
      Severity: Minor
      Found in packages/utils/block-dev/src/mockBlock.js - About 1 hr to fix

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

            <BlockLayout
              blockStyle={block.eval.style}
              id={`bl-${block.blockId}`}
              layout={block.eval.layout}
              makeCssClass={makeCssClass}
        Severity: Major
        Found in packages/client/src/block/List.js and 1 other location - About 1 hr to fix
        packages/client/src/block/Container.js on lines 52..78

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

        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

            <BlockLayout
              blockStyle={block.eval.style}
              id={`bl-${block.blockId}`}
              layout={block.eval.layout}
              makeCssClass={makeCssClass}
        Severity: Major
        Found in packages/client/src/block/Container.js and 1 other location - About 1 hr to fix
        packages/client/src/block/List.js on lines 54..85

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

        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

                <BlockLayout
                  id={`bl-${block.blockId}`}
                  blockStyle={block.eval.style}
                  layout={block.eval.layout}
                  makeCssClass={makeCssClass}
        Severity: Major
        Found in packages/client/src/block/CategorySwitch.js and 1 other location - About 1 hr to fix
        packages/client/src/block/CategorySwitch.js on lines 101..126

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

        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

                type.isObject(properties.copyable)
                  ? {
                      text: properties.copyable.text || properties.content,
                      onCopy: () => {
                        methods.triggerEvent({
        packages/plugins/blocks/blocks-antd/src/blocks/Paragraph/Paragraph.js on lines 30..73

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

        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

                <BlockLayout
                  id={`bl-${block.blockId}`}
                  blockStyle={block.eval.style}
                  layout={block.eval.layout}
                  makeCssClass={makeCssClass}
        Severity: Major
        Found in packages/client/src/block/CategorySwitch.js and 1 other location - About 1 hr to fix
        packages/client/src/block/CategorySwitch.js on lines 70..97

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

        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

              type.isObject(properties.copyable)
                ? {
                    text: properties.copyable.text || properties.content,
                    onCopy: () => {
                      methods.triggerEvent({
        packages/plugins/blocks/blocks-antd/src/blocks/Title/Title.js on lines 34..77

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

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

          updateState() {
            const toSet = new Set();
            const toDelete = new Set();
            this.loopBlocks((block) => {
              if (block.visibleEval.output !== false) {
        Severity: Minor
        Found in packages/engine/src/Blocks.js - About 1 hr to fix

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

                  content: () => {
                    const runAfterUpdate = useRunAfterUpdate();
                    return (
                      <Input.Password
                        id={`${blockId}_input`}

            Function set has 33 lines of code (exceeds 25 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

              Function reviver has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  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/serverParser.js - About 1 hr to fix

                Function callActionLoop has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Confirmed

                  async callActionLoop({ actions, arrayIndices, block, event, progress, responses }) {
                    for (const [index, action] of actions.entries()) {
                      try {
                        if (action.async === true) {
                          this.callAsyncAction({
                Severity: Minor
                Found in packages/engine/src/Actions.js - About 1 hr to fix

                  Function buildRequest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Confirmed

                  function buildRequest(request, pageContext) {
                    const { auth, checkDuplicateRequestId, pageId, typeCounters } = pageContext;
                    if (type.isUndefined(request.id)) {
                      throw new Error(`Request id missing at page "${pageId}".`);
                    }
                  Severity: Minor
                  Found in packages/build/src/build/buildPages/buildBlock/buildRequests.js - About 1 hr to fix

                    Function PhoneNumberInput has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Confirmed

                    const PhoneNumberInput = ({
                      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

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

                      try {
                        const result = instance[methodName](...args);
                        if (meta[methodName].returnInstance) {
                          return instance;
                        }
                    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 95..103

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

                    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

                      try {
                        return functions[methodName](...args);
                      } catch (e) {
                        throw new Error(
                          `Operator Error: ${operator}.${methodName} - ${
                    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 88..100

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

                    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