redux-observable/redux-observable

View on GitHub

Showing 5 of 5 total issues

Function createEpicMiddleware has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createEpicMiddleware<
  T extends Action,
  O extends T = T,
  S = void,
  D = any
Severity: Major
Found in src/createEpicMiddleware.ts - About 2 hrs to fix

    Function epicMiddleware has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const epicMiddleware: EpicMiddleware<T, O, S, D> = _store => {
        if (process.env.NODE_ENV !== 'production' && store) {
          // https://github.com/redux-observable/redux-observable/issues/389
          warn(
            'this middleware is already associated with a store. createEpicMiddleware should be called for every store.\n\nLearn more: https://goo.gl/2GQ7Da'
    Severity: Minor
    Found in src/createEpicMiddleware.ts - About 1 hr to fix

      Function createEpicMiddleware has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      export function createEpicMiddleware<
        T extends Action,
        O extends T = T,
        S = void,
        D = any
      Severity: Minor
      Found in src/createEpicMiddleware.ts - 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 combineEpics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export function combineEpics<T extends Action, O extends T = T, S = void, D = any>(...epics: Epic<T, O, S, D>[]): Epic<T, O, S, D> {
        const merger = (...args: Parameters<Epic>) => merge(
          ...epics.map(epic => {
            const output$ = epic(...args);
            if (!output$) {
      Severity: Minor
      Found in src/combineEpics.ts - About 25 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

      Function ofType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export function ofType<
        // All possible actions your app can dispatch
        Input extends Action,
        // The types you want to filter for
        Type extends Input['type'],
      Severity: Minor
      Found in src/operators.ts - About 25 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