lowdefy/lowdefy

View on GitHub

Showing 9,050 of 9,129 total issues

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

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

        <BlockLayout
          blockStyle={skeleton.style ?? blockStyle}
          id={`s-bl-${blockId}-${skeleton.id}`}
          layout={skeleton.layout ?? blockLayout}
          makeCssClass={makeCssClass}
    Severity: Major
    Found in packages/client/src/block/LoadingContainer.js and 2 other locations - About 1 hr to fix
    packages/client/src/block/LoadingBlock.js on lines 85..101
    packages/client/src/block/LoadingList.js on lines 62..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 66.

    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

        <BlockLayout
          blockStyle={skeleton.style ?? blockStyle}
          id={`s-bl-${blockId}-${skeleton.id}`}
          layout={skeleton.layout ?? blockLayout}
          makeCssClass={makeCssClass}
    Severity: Major
    Found in packages/client/src/block/LoadingList.js and 2 other locations - About 1 hr to fix
    packages/client/src/block/LoadingBlock.js on lines 85..101
    packages/client/src/block/LoadingContainer.js on lines 59..76

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

    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

            <BlockLayout
              blockStyle={skeleton.style ?? blockStyle}
              id={`s-bl-${blockId}-${skeleton.id}`}
              layout={skeleton.layout ?? blockLayout}
              makeCssClass={makeCssClass}
    Severity: Major
    Found in packages/client/src/block/LoadingBlock.js and 2 other locations - About 1 hr to fix
    packages/client/src/block/LoadingContainer.js on lines 59..76
    packages/client/src/block/LoadingList.js on lines 62..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 66.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    Severity: Major
    Found in packages/plugins/connections/connection-redis/src/types.js and 6 other locations - About 1 hr to fix
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    Severity: Major
    Found in packages/plugins/connections/connection-knex/src/types.js and 6 other locations - About 1 hr to fix
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-google-sheets/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

    export default {
      connections: Object.keys(connections),
      requests: Object.keys(connections)
        .map((connection) => Object.keys(connections[connection].requests))
        .flat(),
    packages/plugins/connections/connection-axios-http/src/types.js on lines 20..25
    packages/plugins/connections/connection-elasticsearch/src/types.js on lines 20..25
    packages/plugins/connections/connection-knex/src/types.js on lines 19..24
    packages/plugins/connections/connection-redis/src/types.js on lines 20..25
    packages/plugins/connections/connection-sendgrid/src/types.js on lines 20..25
    packages/plugins/connections/connection-stripe/src/types.js on lines 20..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 65.

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

      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

      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);
      Severity: Major
      Found in packages/servers/server-dev/lib/server/apiWrapper.js and 2 other locations - About 1 hr to fix
      packages/servers/server-community/lib/server/apiWrapper.js on lines 49..60
      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

      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

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