lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

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

    try {
      context.logger = createLogger({ rid: context.rid });
      context.authOptions = getAuthOptions(context);
      if (!req.url.startsWith('/api/auth')) {
        context.session = await getServerSession(context);
packages/servers/server-community/lib/server/apiWrapper.js on lines 49..60
packages/servers/server-dev/lib/server/apiWrapper.js on lines 51..66

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

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

    try {
      context.logger = createLogger({ rid: context.rid });
      context.authOptions = { configured: false };
      createApiContext(context);
      logRequest({ context });
Severity: Major
Found in packages/servers/server-community/lib/server/apiWrapper.js and 2 other locations - About 1 hr to fix
packages/servers/server-dev/lib/server/apiWrapper.js on lines 51..66
packages/servers/server-enterprise/lib/server/apiWrapper.js on lines 46..60

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

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

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

                  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

            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

                    <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

                <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

                    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

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

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

              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 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
                      Severity
                      Category
                      Status
                      Source
                      Language