redux-observable/redux-observable

View on GitHub
src/createEpicMiddleware.ts

Summary

Maintainability
B
5 hrs
Test Coverage

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

      There are no issues that match your filters.

      Category
      Status