cellog/react-redux-saga-router

View on GitHub

Showing 27 of 58 total issues

Function createMiddleware has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const createMiddleware = (
  history = createBrowserHistory(),
  handlers = actionHandlers,
  debug = false
) => {
Severity: Major
Found in src/middleware.ts - About 4 hrs to fix

    File helpers.ts has 331 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { createPath, LocationDescriptorObject } from 'history'
    
    import * as actions from './actions'
    import * as selectors from './selectors'
    import * as enhancers from './enhancers'
    Severity: Minor
    Found in src/helpers.ts - About 3 hrs to fix

      File actions.test-d.ts has 310 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { expectType, expectError, expectAssignable } from 'tsd'
      
      import {
        addRoute,
        FullStateWithRouter,
      Severity: Minor
      Found in src/type-tests/actions.test-d.ts - About 3 hrs to fix

        File actions.ts has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as types from './types'
        import { Location, History } from 'history'
        import { DeclareRoute } from './enhancers'
        import { FullStateWithRouter } from './selectors'
        
        
        Severity: Minor
        Found in src/actions.ts - About 3 hrs to fix

          Function Link has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          export function Link<ExtraProps extends { [key: string]: any }>(
            props: Props & Partial<HTMLAnchor> & ExtraProps
          ) {
            const { to, replace, onClick, href, children, route, ...extra } = props
            const routeInfo = useContext(Context)
          Severity: Minor
          Found in src/Link.tsx - About 2 hrs 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 Link has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function Link<ExtraProps extends { [key: string]: any }>(
            props: Props & Partial<HTMLAnchor> & ExtraProps
          ) {
            const { to, replace, onClick, href, children, route, ...extra } = props
            const routeInfo = useContext(Context)
          Severity: Major
          Found in src/Link.tsx - About 2 hrs to fix

            Function urlFromState has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function urlFromState(
              enhancedRoutes: enhancers.EnhancedRoutes,
              state: selectors.FullStateWithRouter
            ) {
              const toDispatch: actions.IonRouterActions[] = []
            Severity: Major
            Found in src/helpers.ts - About 2 hrs to fix

              Function NullComponent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function NullComponent<WrapperProps extends {}>(
                Loading: React.FC,
                Component: React.FC,
                ElseComponent: React.FC,
                Wrapper: React.FC<WrapperProps>,
              Severity: Minor
              Found in src/NullComponent.tsx - About 2 hrs 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 newStore has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const newStore = <S, A extends Action<any>>(
                  store: Store<S, A> & IonRouterOptions
                ) => {
                  assertEnhancedStore<S & FullStateWithRouter, A | actions.IonRouterActions>(
                    store
              Severity: Minor
              Found in src/middleware.ts - About 1 hr to fix

                Function NullComponent has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function NullComponent<WrapperProps extends {}>(
                  Loading: React.FC,
                  Component: React.FC,
                  ElseComponent: React.FC,
                  Wrapper: React.FC<WrapperProps>,
                Severity: Minor
                Found in src/NullComponent.tsx - About 1 hr to fix

                  Function Toggle has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const Toggle = (props: NullComponentProps) => {
                      const rendered = useRef(0)
                      rendered.current++
                  
                      const {
                  Severity: Minor
                  Found in src/NullComponent.tsx - About 1 hr to fix

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

                    export default function OuterToggle<
                      ExtraProps extends MightDefineVars,
                      StoreState extends FullStateWithRouter
                    >(
                      selector: ReduxSelector<StoreState>,
                    Severity: Minor
                    Found in src/Toggle.tsx - 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 matchRoutesHelper has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const matchRoutesHelper: ActionHandler<actions.RouteAction> = (
                      enhancedRoutes: enhancers.EnhancedRoutes,
                      state: selectors.FullStateWithRouter,
                      action: actions.RouteAction,
                      updateParams: boolean = true
                    Severity: Minor
                    Found in src/helpers.ts - About 1 hr to fix

                      Function createMiddleware has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const createMiddleware = (
                        history = createBrowserHistory(),
                        handlers = actionHandlers,
                        debug = false
                      ) => {
                      Severity: Minor
                      Found in src/middleware.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 listen has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function listen<A extends Action<any>, T extends any>(
                          store: Store<FullStateWithRouter, A> & IonRouterOptions,
                          next: (action: A) => T,
                          action: A
                        ): T {
                      Severity: Minor
                      Found in src/middleware.ts - About 1 hr to fix

                        Function Route has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function Route<
                          ReduxState extends FullStateWithRouter,
                          Params extends { [key: string]: string },
                          ParamsState extends { [key: string]: any },
                          Action extends { type: string; [key: string]: any }
                        Severity: Minor
                        Found in src/Route.tsx - About 1 hr to fix

                          Function enhanceRoute has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function enhanceRoute<
                            ReduxState extends FullStateWithRouter,
                            Params extends { [key: string]: string },
                            ParamsState extends { [key: string]: any },
                            Action extends { type: string; [key: string]: any }
                          Severity: Minor
                          Found in src/enhancers.ts - About 1 hr to fix

                            Function exitRoute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const exitRoute = <
                              ReduxState extends selectors.FullStateWithRouter,
                              Params extends { [key: string]: string },
                              ParamsState extends { [key: string]: any },
                              Action extends { type: string; [key: string]: any },
                            Severity: Minor
                            Found in src/helpers.ts - About 1 hr to fix

                              Function updateState has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function updateState<
                                ReduxState extends selectors.FullStateWithRouter,
                                Params extends { [key: string]: string },
                                ParamsState extends { [key: string]: any },
                                Action extends { type: string; [key: string]: any },
                              Severity: Minor
                              Found in src/helpers.ts - About 1 hr to fix

                                Function NullComponent has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  Loading: React.FC,
                                  Component: React.FC,
                                  ElseComponent: React.FC,
                                  Wrapper: React.FC<WrapperProps>,
                                  wrapperProps: WrapperProps,
                                Severity: Major
                                Found in src/NullComponent.tsx - About 50 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language