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
) => {
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'
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,
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'
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)
- Read upRead up
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)
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[] = []
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>,
- Read upRead up
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
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>,
Function Toggle
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Toggle = (props: NullComponentProps) => {
const rendered = useRef(0)
rendered.current++
const {
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>,
- Read upRead up
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
Function createMiddleware
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const createMiddleware = (
history = createBrowserHistory(),
handlers = actionHandlers,
debug = false
) => {
- Read upRead up
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 {
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 }
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 }
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 },
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 },
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,