lowdefy/lowdefy

View on GitHub

Showing 9,449 of 9,537 total issues

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

function getAuthOptions({ logger }) {
  return getNextAuthConfig({
    authJson,
    logger,
    plugins: { adapters, callbacks, events, providers },
packages/servers/server-dev/lib/server/auth/getAuthOptions.js on lines 26..33

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

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

    if (gridRef.current.api) {
      if (loading) {
        gridRef.current.api.showLoadingOverlay();
      }
      if (!loading) {
Severity: Major
Found in packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js and 1 other location - About 1 hr to fix
packages/plugins/blocks/blocks-aggrid/src/AgGrid.js on lines 137..144

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

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

    if (gridRef.current.api) {
      if (loading) {
        gridRef.current.api.showLoadingOverlay();
      }
      if (!loading) {
Severity: Major
Found in packages/plugins/blocks/blocks-aggrid/src/AgGrid.js and 1 other location - About 1 hr to fix
packages/plugins/blocks/blocks-aggrid/src/AgGridInput.js on lines 185..192

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

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 getCallbackUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Confirmed

function getCallbackUrl({ lowdefy, callbackUrl = {} }) {
  const { home, pageId, urlQuery, url } = callbackUrl;

  if ([!home, !pageId, !url].filter((v) => !v).length > 1) {
    throw Error(
Severity: Minor
Found in packages/client/src/auth/createAuthMethods.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function ParagraphInput has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const ParagraphInput = ({
  blockId,
  components: { Icon },
  events,
  loading,

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function set has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function set(target, path, value, options) {
  if (!type.isObject(target)) {
    return target;
  }

Severity: Minor
Found in packages/utils/helpers/src/set.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

async function fetchNpmTarball({ packageName, version, directory }) {
  const registryUrl = `https://registry.npmjs.org/${packageName}`;
  let packageInfo;
  try {
    packageInfo = await axios.get(registryUrl);
Severity: Minor
Found in packages/cli/src/utils/fetchNpmTarball.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reviver has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

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

    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 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 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(),
    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-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-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-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(),
    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-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 = 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

      Severity
      Category
      Status
      Source
      Language