r37r0m0d3l/of

View on GitHub

Showing 6 of 18 total issues

Function ofAnyCase has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function ofAnyCase(callable, config = {}) {
  {
    const { args, defaults, error, retries, timeout } = { ...config };
    config = { args, defaults, error, retries, timeout };
  }
Severity: Major
Found in src/core/ofAnyCase.js - About 3 hrs to fix

    Function ofAny has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function ofAny(callable, args, defaultResult, overrideError) {
      let call;
      switch (callable.constructor.name || Object.prototype.toString.call(callable)) {
        case PROMISE:
          call = callable;
    Severity: Major
    Found in src/core/ofAny.js - About 2 hrs to fix

      Function ofAnyCase has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      export function ofAnyCase(callable, config = {}) {
        {
          const { args, defaults, error, retries, timeout } = { ...config };
          config = { args, defaults, error, retries, timeout };
        }
      Severity: Minor
      Found in src/core/ofAnyCase.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 ofCase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function ofCase(promise, config = {}) {
        {
          const { args, defaults, error, timeout } = { ...config };
          config = { args, defaults, error, timeout };
        }
      Severity: Minor
      Found in src/core/ofCase.js - About 1 hr to fix

        Function ofCase has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        export function ofCase(promise, config = {}) {
          {
            const { args, defaults, error, timeout } = { ...config };
            config = { args, defaults, error, timeout };
          }
        Severity: Minor
        Found in src/core/ofCase.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 ofSync has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        export function ofSync(callable, args, defaultResult, overrideError) {
          if (!isFunction(callable)) {
            return [undefined, new Error(ERR_UNKNOWN)];
          }
          try {
        Severity: Minor
        Found in src/core/ofSync.js - About 55 mins 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

        Severity
        Category
        Status
        Source
        Language